Why is with-syntax required in this example?
Hi
I am wondering why the 1st with-syntax is needed in the follow example.
(import (rnrs))
(define-syntax foo
(lambda (x)
(define (bar e)
(lambda (x)
[(x) #'e]))))
(syntax-case x ()
[(_ e r ...)
#'(list r ...))])))
(define x 'hi)
(display (foo x (a) (b)))
(newline)
Removing the with-syntax, the snippet fails with:
&who: e
&message: "identifier out of context"
&syntax: e
&source-
&trace: #<syntax e [(9,18) - (9,21) of c:\Program Files\xacc.
&trace: #<syntax (foo x (a) (b)) [(17,10) - (17,25) of c:\Program Files\xacc.
Any clarification will be helpful. Maybe a bug?
Cheers
leppie
Question information
- Language:
- English Edit question
- Status:
- Solved
- Assignee:
- No assignee Edit question
- Solved by:
- Abdulaziz Ghuloum
- Solved:
- Last query:
- Last reply: