On 10/24/2016 02:15 PM, Dan Liebgold wrote:
On Sunday, October 23, 2016 at 1:14:56 PM UTC-7, Ryan Culpepper wrote:
[...]
1. A term like `(a <- blend)` will match the first pattern and treat
`blend` as a `remap:id`. If you don't want that to happen, there are two
ways to prevent it. One is to define a syntax class like `id` that
excludes all of the reserved words like `<-` and `blend` and use that
for pattern variables like `remap`. The other is to reorder the patterns
and use cut (~!):
(pattern (source:id <- blend ~! remap:id
extras:remap-entry-extra-params))
(pattern (source:id <- remap:id extras:remap-entry-extra-params))
This one is surprising. I thought that listing 'blend' as a datum-literal would
prevent the more general 'remap:id from matching it.
It might make sense for syntax-parse to offer something like Redex's
`variable-not-otherwise-mentioned`, which would behave like you
expected. I think it would have to be a baked-in special case, but it
might be useful enough to justify that.
I ran into the same issue recently when designing an(other) S-expression
notation for SQL.
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.