[plt-scheme] Binding transformers in a macro

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Thu Oct 23 12:32:03 EDT 2008

Actually, I think you always want just

 #`(define-syntax #,import-id (make-rename-transformer #'#,real-import-id))

That will work whether `real-import-id' has a regular or transformer
binding, so you don't need the `transformer?' test.


At Thu, 23 Oct 2008 17:13:20 +0100, "Noel Welsh" wrote:
> (define-for-syntax (make-define-form import-id real-import-id context)
>   (if (transformer? real-import-id)
>       (let ([transformer (syntax-local-value real-import-id)])
>         (datum->syntax context
>                        `(define-syntax ,import-id ,transformer)))
>       (datum->syntax context
>                      `(define ,import-id ,real-import-id))))



Posted on the users mailing list.