This works:
 
#lang racket
(define-syntax (x y) (syntax-case y () (_ (syntax (quote monkey)))))
x ; -> monkey
 
This does not work
 
#lang racket/base
(define-syntax (x y) (syntax-case y () (_ (syntax (quote monkey)))))
 
gives the expansion time error:
 
syntax-case: unbound identifier in the transformer environment;
 also, no #%app syntax transformer is bound in: syntax-case
 
This does work:
 
#lang racket/base
(require (for-syntax (only-in racket/base syntax syntax-case)))
(define-syntax (x y) (syntax-case y () (_ (syntax (quote monkey)))))
x ; -> monkey
 
And this works too:
 
#lang racket/base (syntax-case #'x () #''monkey) -> monkey
 
This puzzles me. Both syntax-case and syntax are provided by both
racket/base and racket.
It is as though racket provides syntax and syntax-case for syntax too and
that syntax/base does not.
Probably I am misunderstanding things, but what?
 
Thanks, Jos

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to