On 11/16/2016 08:24 PM, Dan Liebgold wrote:
FWIW, Eric Dobson wrote a very nice `define-literal-syntax-class` macro
that is used extensively inside TR.

    
https://github.com/racket/typed-racket/blob/master/typed-racket-lib/typed-racket/utils/literal-syntax-class.rkt


Hmm... I can't quite figure that one out. Maybe with some examples?
How does the ":spec" in the pattern work?  It's just a class
specified....

Suppose you have

  (define-syntax-class sc #:attributes (a b) ....)

The pattern x:sc or (~var x sc) binds x, x.a, and x.b.
The pattern :sc or (~var || sc) binds just a and b (no prefix).
The pattern _:sc or (~var _ sc) binds nothing.

Note that || is a way of writing the 0-length identifier in Racket.

Ryan

--
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.

Reply via email to