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

Its companion `define-merged-syntax-class` is quite nice too.

   
https://github.com/racket/typed-racket/blob/master/typed-racket-lib/typed-racket/optimizer/utils.rkt#L110

I've used those in other projects as well, and like them a lot.

Ryan: Would you consider adding them (or something like them) to
syntax/parse?

Vincent



On Wed, 16 Nov 2016 17:11:26 -0600,
Dan Liebgold wrote:
> 
> Hi,
> 
> A couple questions about literals in syntax-parse:
> 
> 1. I'd like to make a syntax-class that is just a set of literals (with a 
> clear error for something not matching any literal). Is there a better way 
> than this:
> 
> http://pasterack.org/pastes/86722
> 
> I need to ignore the bindings for those identifiers, and I need to preserve 
> the syntax context.
> 
> 2. Is there any plan or easy way to implement #:datum-literal-sets  for 
> syntax-classes?  It'd be nice to share a list of literals (with ignored 
> bindings) among multiple classes.
> 
> Thanks,
> Dan
> 
> -- 
> 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.

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