How would I go about doing this? Is there a certain function that can tell if something is a top-level declaration?
On Thursday, August 16, 2018 at 6:44:53 PM UTC-6, Philip McGrath wrote: > > You probably want to partially expand the expressions, collect the > definitions, and lift them to the module level. > > -Philip > > On Thu, Aug 16, 2018 at 11:58 PM, Vityou <zle...@gmail.com <javascript:>> > wrote: > >> I'm attempting to make a language similar to scribble. I'm using the >> `make-at-reader` that scribble provides, and have my module-begin as this: >> >> (define-syntax md-module-begin >> (syntax-parser >> [(_ (expr1 ...)) #'(#%module-begin (define doc (parse-markdown >> (string-append (begin expr1) ...))) >> (provide doc) >> doc)])) >> >> This works good for normal expressions, but when I try to do something >> like `define`, it complains that it is not allowed in expression context. >> I tried fixing this by wrapping expressions in `begin`, but I still get the >> same error. Is there any way to fix this? Thanks for any help. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Racket Users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to racket-users...@googlegroups.com <javascript:>. >> For more options, visit https://groups.google.com/d/optout. >> > > -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.