[plt-scheme] Language spec

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Wed Dec 17 12:19:25 EST 2003

Continuing a very old thread...

At Thu, 30 Oct 2003 11:01:45 -0500, David Van Horn wrote:
> It has come up on this list before (although now I can't find a reference), 
> whether the language position of the module syntax could be an arbitrary 
> require form, allowing for identifier renaming, exclusion, etc.
> 
> What was the conclusion on this issue?  Is this a feature to expect in future 
> versions of PLT?

I don't think there's been a good answer before, but now I remember why
I made the language position a module path instead of a require form: I
imagined that require forms (and provide forms) would be imported, just
like any other syntactic form.

Right now, if you want a new kind of require form, you have to
implement a new `require'-like macro, such as `require/reversed':

   (require/reversed (lib "file.ss"))

In principle, though, `require' could support extension through
something like

 (define-syntax reversed
   (make-require-tranformer ...))

so that

 (module m mzscheme
   ...
   (require (reversed (lib "file.ss")))
   ...)

would import `find-relative-path' from `(lib "file.ss")' as
`htap-evitaler-dnif', etc. This is a silly example, but there are
certainly useful forms that could be added for `require'.

If require forms are imported, then the problem with using them in the
language position is that none have been imported so far. We could
designate a special set of forms that are allowed in the language
position, but that seems arbitrary.

Of course, we haven't made require forms imported so far, and we have
arbitrarily fixed a set of require forms for now. I'm not sure whether
it's more important in the future to allow the definition of new
require forms or to allow require forms in the language position, but I
lean toward the former.

Matthew



Posted on the users mailing list.