Re: [racket-users] syntax-class composed of literals

2016-11-17 Thread Vincent St-Amour
On Wed, 16 Nov 2016 21:42:14 -0600, Ryan Culpepper wrote: > > On 11/16/2016 07:51 PM, Vincent St-Amour 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/typ

Re: [racket-users] syntax-class composed of literals

2016-11-16 Thread Ryan Culpepper
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 fig

Re: [racket-users] syntax-class composed of literals

2016-11-16 Thread Ryan Culpepper
On 11/16/2016 07:51 PM, Vincent St-Amour 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 Its companion `define-

Re: [racket-users] syntax-class composed of literals

2016-11-16 Thread Ryan Culpepper
On 11/16/2016 07:42 PM, Dan Liebgold wrote: Literal sets can include datum-literals: (define-literal-set lits #:datum-literals (a b c) (d e)) Ah, oops I missed that keyword parameter. For question 1, that's probably the best way. If you want to suppress the printing of all of the datum

Re: [racket-users] syntax-class composed of literals

2016-11-16 Thread Dan Liebgold
> 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 ex

Re: [racket-users] syntax-class composed of literals

2016-11-16 Thread Vincent St-Amour
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:

Re: [racket-users] syntax-class composed of literals

2016-11-16 Thread Dan Liebgold
> > Literal sets can include datum-literals: > >(define-literal-set lits #:datum-literals (a b c) (d e)) > Ah, oops I missed that keyword parameter. > For question 1, that's probably the best way. If you want to suppress > the printing of all of the datum literals in error messages, you c

Re: [racket-users] syntax-class composed of literals

2016-11-16 Thread Ryan Culpepper
On 11/16/2016 06:11 PM, 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

[racket-users] syntax-class composed of literals

2016-11-16 Thread Dan Liebgold
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 ident