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
cheers,
felix