[plt-scheme] literal-identifiers and modules
Well, it seems wrong but I think I know the problem.
(z (+ 1 2)) actually recieves as parameters +, 1 and 2. Since + is a
literal it expects the parameter + to be the same as the in-module +,
and produces an error whenever it is not.
The + inside the module is not the same as the + outside, and providing
it in the module solves your problem.
Katsmall T. Wise, Esquire
David Van Horn wrote:
> For list-related administrative tasks:
> http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>
>If I define a syntax like this at the top-level,
>
> (define-syntax z
> (syntax-rules (+)
> ((_ (+ x y)) (+ x y))))
>
>then (z (+ 1 2)) => 3.
>
>However if I define z in a module and require it at the top-level, (z (+ 1 2))
>results in a syntax error, z: bad syntax in: (z (+ 1 2)). If I use a literal
>identifier like add instead of +, z works as expected. Is this intended?
>
>Thanks.
>
>-d
>
>
>
>