[plt-scheme] Generating top-level definitions from inner syntax
From: Lauri Alanko (la at iki.fi)
Date: Wed Oct 8 18:24:16 EDT 2003 |
|
On Wed, Oct 08, 2003 at 06:07:11PM -0400, Eli Barzilay wrote:
> > Hm, all right, thanks. But that seems ugly: it requires the _syntax
> > transformer_ to compile the regexp, when in actuality the regexp
> > compilation should be done at the _next_ stage. This seems to break
> > the principle that you shouldn't be able to put non-syntactic data
> > in syntax expansions...
>
> Why? Scheme has some predefined sets of `self-evaluating' values,
> which you can use as syntax (so it's ok to (eval (list '+ 1)) instead
> of (eval (list '+ '1))), and the #rx thing adds (compiled) regexps as
> an additional one.
I think I just expect self-evaluating values to be "trivial" to handle,
and regexps don't quite fit the definition. Compiling a regexp is much
more complicated than just creating a similar syntax object, and this is
where it differs from numbers and strings. It's just work done at the
wrong phase. Of course the matter would be different if an actual
compiled state machine were directly externalized, instead of just the
posix string.
But this is really just a matter of taste, nothing very fundamental.
Lauri Alanko
la at iki.fi