[plt-scheme] flavoured modules

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Thu Jul 19 09:06:39 EDT 2007

Linguistically units are clearly the right thing because you probably  
want to parameterize over the representation specific stuff.

 From an IDE perspective, you're stuck.

Based on your sketch, I believe you have re-invented existentials. --  
Matthias




On Jul 19, 2007, at 3:58 AM, Jos Koot wrote:

> Hi,
> A question: Consider two modules like
>
> (module flavour-A mzscheme
>
>  some flavour-A specific definitions defining a representation
>
>  a longer text defining and providing a number of representation  
> independent procedures using the representation)
>
> Idem for representation B with exactly the same
> representation independent part.
>
> In order to avoid duplication of the
> representation independent part,
> i did the following:
>
> (module representation-independent mzscheme
>  (define-syntax representation-independent
>   (syntax-rules ()
>    ((_ all identifiers defining the representation)
>     (begin
>      representation independent code)))))
>
> (module flavout-A mzscheme
>  (require representation-independent)
>  representation definitions
>  (representation-independent
>   all identifiers defining the representation))
>
> Same for flavour B representation
>
> This works allright. However, a disadvantage is that in module  
> representation-indepenent the check-syntax tool cannot give much  
> information because all code is in a template. Is there a smarter  
> way to accomplish my goal? I rather like to avoid going back to units.
> Best wishes, Jos koot.
> _________________________________________________
>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme



Posted on the users mailing list.