Re: [racket-users] how to match unbound identifier as literal in `syntax-parse`?

2018-04-03 Thread Matthew Butterick
> On Apr 3, 2018, at 4:37 AM, Ryan Culpepper wrote: > > Here's one way: > > (~and z:id > (~fail #:unless (free-identifier=? #'z #'zeta) > "expected the identifier `zeta`")) > > Another way is to make a syntax class (either specifically for `zeta` or >

Re: [racket-users] how to match unbound identifier as literal in `syntax-parse`?

2018-04-03 Thread Ryan Culpepper
Here's one way: (~and z:id (~fail #:unless (free-identifier=? #'z #'zeta) "expected the identifier `zeta`")) Another way is to make a syntax class (either specifically for `zeta` or parameterized by the identifier) that does the same check. Ryan On 4/3/18 8:33 AM,

[racket-users] how to match unbound identifier as literal in `syntax-parse`?

2018-04-03 Thread Matthew Butterick
Consider the difference in results below. How would I persuade `syntax-parse` to match literal identifiers in the `free-identifier=?` sense that `syntax-case` does? (and thereby allow unbound identifiers to be compared also) IIUC, `#:literals` is too strict, as it insists that every listed