[plt-scheme] flavoured modules

From: Jos Koot (jos.koot at telefonica.net)
Date: Sat Jul 21 17:41:19 EDT 2007

Hi Ryan,
No, I did not know of the existence of (lib "include.ss").
I checked it, it works fine, is more flexible and seems to satisfy my needs.
I looked into the source of include.ss and it seems clear to me why my first 
attempts did not work:
include.ss recurs on the syntax-e of the syntaxes to be included, whereas I 
tried to avoid this.
Do I understand correctly that (datum->syntax-object cstx stx) does not attach 
the cstx to the components of the syntax of a pair or list or improper list?
That would explain my misunderstanding.
It's clear why include.ss does not recur on  #hash((k . v|) ...): syntax-e does 
not decompose it.
I wonder why include.ss does not have to recur on #hash((k . v|) ...) whereas it 
does recur on #(e ...) and #&c, which seems to imply the necessity of recurring 
on vectors and boxes.
Thanks a lot.

----- Original Message ----- 
From: "Ryan Culpepper" <ryanc at ccs.neu.edu>
To: "Jos Koot" <jos.koot at telefonica.net>
Cc: "PLT-list" <plt-scheme at list.cs.brown.edu>
Sent: Saturday, July 21, 2007 9:26 PM
Subject: Re: [plt-scheme] flavoured modules

> On Sat, 2007-07-21 at 20:48 +0200, Jos Koot wrote:
>> Hi,
>> With help of the PLT-list I succeeded in making flavoured or
>> composable modules, as I call them. Thanks Matthias and Scott! I am
>> afraid though, that I dont fully understand what I am doing in the two
>> lines marked with <======.
>> Jos Koot
> Have you looked at the 'include' macro? You could write your 'example-1'
> macro from below as follows:
> (module example-1 mzscheme
>  (require (lib "include.ss")
>  (include "part1.scm")
>  (include "part2.scm")
>  (include "part3.scm"))
> That might serve your purposes better than a new language module.
> I'll try to send an explanation of the two lines later this evening. The
> short answer: Try it out in the macro stepper (you may have to disable
> macro hiding; there's a bug lurking in the module-handling code). Notice
> that the require forms and all of the inserted code have the same
> mark/color.
> Ryan

Posted on the users mailing list.