[racket] How to use structure inside define-syntax ?

From: Jos Koot (jos.koot at telefonica.net)
Date: Thu Apr 21 09:36:22 EDT 2011

That is identical to my (corrected) answer :)
You just were 3 minutes quicker than I was.
Jos 

> -----Original Message-----
> From: Matthew Flatt [mailto:mflatt at cs.utah.edu] 
> Sent: 21 April 2011 15:27
> To: Veer
> Cc: Jos Koot; users at racket-lang.org
> Subject: Re: [racket] How to use structure inside define-syntax ?
> 
> At Thu, 21 Apr 2011 18:34:45 +0530, Veer wrote:
> > I still get error when i do
> > 
> > (begin-for-syntax
> >   (struct proc-struct  (name args loe)))
> > 
> > error:  " define-syntaxes: syntax definitions not allowed within
> > begin-for-syntax ..."
> 
> This is a limitation of the module system (which I hope to remove one
> day soon). Work around it by adding `#:omit-define-syntaxes':
> 
>  (begin-for-syntax
>    (struct proc-struct (name args loe)
>            #:omit-define-syntaxes))
> 
> 
> You could also use `struct' in a separate module that is imported with
> `(require (for-syntax ...))', but maybe you want to keep everything in
> one module.
> 



Posted on the users mailing list.