[plt-scheme] syntax-local-context?

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Wed Feb 14 09:11:42 EST 2007

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


Posted on the users mailing list.