[racket] reconstructing syntax objects

From: Jon Rafkind (rafkind at cs.utah.edu)
Date: Thu Nov 17 14:28:26 EST 2011

I have some code that deconstructs and reconstructs a syntax object. I'm pretty sure this code is at fault for not adding the proper lexical context back on so I get an error about 'no #%app bound'.

(syntax-parse form
[(form ...)
      (with-syntax ([(form* ...) (map honu->racket (syntax->list #'(form ...)))])
        (datum->syntax forms
                       #'(form* ...)
                       forms
                       forms))]

I had hoped that datum->syntax would add the original lexical context back on, is it not doing what I hoped?


Posted on the users mailing list.