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: Kon Lovett
Subject: Re: Re : [Chicken-users] various questions
Date: Fri, 12 Jan 2007 08:42:20 -0800

-----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.



cheers,
felix


_______________________________________________
Chicken-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/chicken-users

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)

iEYEARECAAYFAkWnumwACgkQJJNoeGe+5O6M5QCcCe8eIhP+tcKlzdpRrw5XM0rn
4JsAn1fEfwkMTLvDx9nqUV2fzYPmzr/Y
=D0Km
-----END PGP SIGNATURE-----




reply via email to

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