Depends on what `x` is, both symbolically and in terms of binding:

(for/first ([(list _) #hash([(a) . 1])])
  list)

(define-match-expander x
  (syntax-rules ()
    [(_ pat) (list pat)]))

(match '(ok)
  [(x v)
   v])

-Philip


On Fri, Nov 23, 2018 at 11:41 PM Greg Hendershott <greghendersh...@gmail.com>
wrote:

> > The trouble, sadly, is that this grammar is ambiguous. In
> >
> >   (for ([(x y) s])
> >     ....)
> >
> > should (x y) be parsed as a single match pattern or as two binders for a
> two-valued sequence (such as one produced by in-hash, for example)?
>
> Unless I'm being dense, (x y) isn't a valid single match pattern?
>
> [Quasipatterns like `(x y) or `(,x ,y) would be.]
>
> But even if it is grammatically possible, like I said at the end, I'm
> not sure it's worthwhile.
>
> --
> 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