[plt-scheme] flavoured modules

From: Jos Koot (jos.koot at telefonica.net)
Date: Thu Jul 19 10:43:02 EDT 2007

Hi Matthias,

----- Original Message ----- 
From: "Matthias Felleisen" <matthias at ccs.neu.edu>
To: "Jos Koot" <jos.koot at telefonica.net>
Cc: "PLT-list" <plt-scheme at list.cs.brown.edu>
Sent: Thursday, July 19, 2007 3:06 PM
Subject: Re: [plt-scheme] flavoured modules

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

Exactly, but my representations include macros.
A far as I know units cannot import/export macros.

> From an IDE perspective, you're stuck.
> Based on your sketch, I believe you have re-invented existentials. --  
> Matthias

Never heard of them, but I'll look it up.
Thanks, your ever gratefull apprentice, Jos

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