On May 1, 2008, at 3:48 PM, Stephen Wrobleski wrote: > Basically, I'd like to grab the value associated with a syntax binding > > ; mzscheme example > > (define-syntax print-syntax-value > (lambda (stx) > (syntax-case stx () > ((_ id) > (identifier? #'id) > (begin > (display (syntax-local-value #'id)) > (newline) > #'(begin)))))) > > (define-syntax vv 42) > > ; displays 42 during expansion phase > (print-syntax-value vv)
Does this only work at the top-level?
> (let ([x 3]) (print-syntax-value x) 12) syntax-local-value: not defined as syntax: #<syntax::298> === context === /Applications/PLT Scheme v3.99.0.18/collects/scheme/private/misc.ss:68:7
On May 1, 2008, at 3:48 PM, Stephen Wrobleski wrote:
> Basically, I'd like to grab the value associated with a syntax binding
>
> ; mzscheme example
>
> (define-syntax print-syntax-value
> (lambda (stx)
> (syntax-case stx ()
> ((_ id)
> (identifier? #'id)
> (begin
> (display (syntax-local-value #'id))
> (newline)
> #'(begin))))))
>
> (define-syntax vv 42)
>
> ; displays 42 during expansion phase
> (print-syntax-value vv)
Does this only work at the top-level?
> (let ([x 3]) syntax- value x) 18/collects/ scheme/ private/ misc.ss: 68:7
(print-
12)
syntax-local-value: not defined as syntax: #<syntax::298>
=== context ===
/Applications/PLT Scheme v3.99.0.