Sam TH scripsit:
> This proposal seems like it would benefit from looking at what PLT has
> done with readtables and extensible lexical syntax. In particular,
> Matthew Flatt's ICFP '09 paper [1], Eli Barzilay's Scheme Workshop '09
> paper [2], and the documentation [3].
The two papers are interesting demonstrations of what can be done with
fully redefinable syntax (similar results were achieved in SGML, making
it possible to read Lisp programs as SGML documents), but don't explain
any of the mechanism. The documentation at 12.9 that you point to is
very obscure, but by poking around I eventually found what appears to
be the essence of #lang in this sentence from 12.6.13:
When the reader encounters #reader (of which #lang is a close
variant), it loads an external reader procedure and applies it
to the current input stream.
This is equivalent to executing arbitrary Scheme code in the context
of the compiler. PLT Scheme has to be able to do this anyhow because
it has low-level macros, but nothing in R5RS or small Scheme as I have
so far proposed it requires this capability. To make explicit what PLT
leaves implicit here requires precisely "eval-when", which is always a
dangerous thing because in all standards the environment of the compiler
is underspecified.
My design is sharply limited precisely to prevent this necessity (which I
refer to as "the phasing problem") and to make small Scheme compilation
an entirely static process. I have, of course, nothing against
implementations that *do* allow such dynamic behavior in their compilers.
--
I marvel at the creature: so secret and John Cowan
so sly as he is, to come sporting in the pool [email protected]
before our very window. Does he think that http://www.ccil.org/~cowan
Men sleep without watch all night?
_______________________________________________
r6rs-discuss mailing list
[email protected]
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss