On Wednesday, November 2, 2016 at 5:25:03 AM UTC-7, Jay McCarthy wrote: > > Another approach is to do something like: > > > (define-syntax (myfor stx) > (syntax-parse stx > [(_ (clause:for-clause ...) body:expr) > (with-syntax ([(the-ast ...) (attribute clause.ast)]) > #''(the-ast ... body))])) >
This seems promising, but I'm not sure how to access the contents of structure referred to by the-ast (or clause.ast)... it seems like the struct bindings need to be accessible at both syntax and runtime phases? > > As for examples, one of my favorite ones is this regular expression compiler > implemented as a syntax-class where each attribute is kind of like a "method" > that is called on the sub-components during the compilation: > > > https://github.com/jeapostrophe/automata/blob/master/automata-lib/re-compile.rkt > This is interesting, and seems to point the way to implementing more logic in the syntax phase. I'm wondering if this is how the examples from the docs would be best completed... -- 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.