Comment 1 for bug 225387

Revision history for this message
Abdulaziz Ghuloum (aghuloum) wrote : Re: [Bug 225387] [NEW] add something like plt's syntax-local-value

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