[plt-scheme] preserving the lack of an inferred name
Eli Barzilay writes:
> (define-syntax (keep-name stx)
> (syntax-case stx ()
> ((_ x)
> (let ((name (syntax-local-name)))
> (with-syntax ((x (syntax-property #'x 'inferred-name name))
> (name name))
> (syntax/loc stx
> (begin (display 'name)
> (newline)
> x)))))))
Well, the point (which may have been lost in my toy example) is that I
need to use `let' in the macro because I need to refer to the
expression twice, but only want to execute it once. I tried using
`((lambda (foo) ...) x)' but that cleverly sets the inferred name the
same as `(let ((foo x)) ...)'.
--dougo at place.org