[plt-scheme] transformer binding

From: Ed Cavazos (proteus at theworld.com)
Date: Wed May 7 01:28:31 EDT 2003

David Van Horn <dvanhorn at cs.uvm.edu> writes:

> I'm probably missing something obvious here, but how do I bind f in g's
> transformer environment here?  TIA.
> 
> (module z mzscheme
>   (define (f x) x)
>   (define-syntax (g stx)
>     (syntax-case stx ()
>       ((_ e)
>        (datum->syntax-object stx (f (syntax-object->datum #'e))))))
>   )

I think require-for-syntax can help here. If you put the helper
function inside a module, I think require-for-syntax will let you use
it inside macro definitions. I'm a total syntax newbie so take this
with a 5-pound bag of salt. Anywho, check this link out:

        http://download.plt-scheme.org/doc/204/html/mzscheme/mzscheme-Z-H-12.html#node_idx_2072

Ed



Posted on the users mailing list.