chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re : Re : [Chicken-users] various questions


From: minh thu
Subject: Re : Re : [Chicken-users] various questions
Date: Fri, 12 Jan 2007 21:14:36 +0100

2007/1/12, Kon Lovett <address@hidden>:
-----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.


Thanks for pointing this. I'll try for the moment to stick to somewhat
standard Sheme because I'm fairly noob and don't want to learn another
library (in addition of Scheme and chicken specifics). Probably later
though.

thu




reply via email to

[Prev in Thread] Current Thread [Next in Thread]