-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Jan 12, 2007, at 12:31 AM, felix winkelmann wrote:
> On 1/11/07, minh thu <address@hidden> wrote:
>> >
>> > Could you elaborate on this? Do you want to let the user specify
>> the
>> > actual record type, or it's contents?
>> The record type.
>> Say mailbox use a list-based queue implementation (so 'mailbox' in
>> the
>> following sentences is a hypothetical one).
>> Could I provide another implementation of a queue to be used by
>> mailbox?
>> Or could the author of mailbox make it possible by providing
>> different
>> implementations ?
>> I don't know module systems but maybe my question is wheter we can
>> parametrize a module when loading (instanciating ?) it.
>>
>
> Well, this is what is called "functors" in SML, for example:
> parameterized
> modules. You provide a module implementing the operations on
> a specific datatype and pass this module to your mailbox module.
> A (very basic) implementation of such functors is in the "lexmod" egg:
>
> http://chicken.wiki.br/lexmod
The 'levenshtein' egg has a generic algorithm, it works w/ strings or
vectors. It uses the facilities of 'procedure-surface' to provide the
appropriate procedures.