[plt-scheme] syntax-local-context?
At Wed, 14 Feb 2007 14:53:35 +0100, "jos koot" wrote:
> The following confuses me:
>
> (define-syntax (show-local-context stx)
> (syntax-case stx ()
> ((show-local-context x)
> (let ((x (syntax x)))
> (printf "~s ~s.~n" (syntax-object->datum x) (syntax-local-context))
> x))))
>
> (let ((d (show-local-context (add1 2)))) d) ; --> 3
> ; displayed: (add1 2) top-level.
>
> I expected display: (add1 2) expression. Do I misunderstand the manual or
> (less probably) is this a bug?
It's a bug, now fixed in SVN.
The bug was in the expander for `let-values', and only in the path for
`expand' (as opposed to compiling directly to bytecode). DrScheme and
errortrace use `expand', so the bug showed up there, but not in plain
MzScheme.
Thanks,
Matthew