On May 26, 2009, at 7:55 AM, Michele Simionato wrote:
The line you are referring to is this one:
(syntax-case x (literals ...) ; meta-level 1
Originally I thought to split it in two:
(syntax-case x ; meta-level 1
(literals ...) ; meta-level 0
but then I run out of vertical space! Moreover I thought that after
all literals do not belong to any level, they are just literals. Plus,
since they are matched by the compiler at compile time, it is not
so wrong to put them at meta-level 1 and to save a line ;-)
You'd think they're 'just literals' (as they should be). But they're
not! At least, not according to larceny.
$ cat /tmp/test.ss
#!r6rs
(import (except (rnrs) car) (for (only (rnrs) car) (meta 100)))
(define-syntax foo
(syntax-rules (car)
[(_ car) 12]
[(_ other) 13]))
(write (foo car))
(newline)
$ larceny -r6rs -program /tmp/test.ss
Syntax violation: invalid reference
Attempt to use binding of car in library (program~1a6WuT~2) at
invalid level 0. Binding is only available at levels: 100 101
Form: car
Trace:
(foo car)
Error: no handler for exception #<record &compound-condition>
Compound condition has these components:
#<record &error>
#<record &who>
who : syntax-violation
#<record &message>
message : "invalid reference: Attempt to use binding of car in
library (\x0;program~1a6WuT~2) at invalid level 0. Binding is only
available at levels: 100 101"
#<record &irritants>
irritants : (car)
Terminating program execution.