[plt-scheme] Check Syntax & mangled identifiers

From: Tom Schouten (tom at zwizwa.be)
Date: Sun May 24 03:27:28 EDT 2009

That fixes it.
Thanks!

On Sun, May 24, 2009 at 05:34:55AM +0800, Chongkai Zhu wrote:
> Just keep the srcloc and the original prop of the identifier seems to be  
> enough for me.
>
> Chongkai
>
> #lang scheme
> (require (for-syntax scheme))
>
> (define-for-syntax (underscore stx)
>  (datum->syntax stx
>                 (string->symbol
>                  (format "_~a"
>                          (syntax->datum stx)))
>                 stx
>                 stx))
>
> (define-syntax (u stx)
>  (syntax-case stx ()
>    ((_ (name val) . body) #`(let ((#,(underscore #'name) val)) . body))
>    ((_ id) (underscore #'id))))
>
> ;; case 1
> (u (x 123) (u x))       
>
> ;; case 2
> (let ((_x 123))
>  (u x))
> (u (x 123) _x)
>
>


Posted on the users mailing list.