It looks like there are a few things going on here.

1. ,@(list-rest a) doesn't work in general in quasi-patterns.  That's
because (list-rest a) matches anything, and ,@() patterns expect to
take something that only match lists. It's ok to have them at the end
of something, as you do here, so I'll add a special case for that.

2. Currently, `match` doesn't think of the contents of a struct as a
sequence where ,@() patterns would make sense. I'll work on handling
that as well, since I see that quasiquote supports it. However, this
seems to do violence to the idea of structs, so I'm not sure why you'd
want it.

Sam

On Wed, Nov 9, 2016 at 7:04 PM, 'William J. Bowman' via Racket Users
<[email protected]> wrote:
> The following simple example does not behave as expected on my machine. Am I 
> expecting wrong or is the machine behaving wrong?
>
> ```
> #lang racket
>
> (struct meow (e) #:prefab)
>
> (require racket/match)
>
> (match #s(meow 1)
>   [`#s(meow ,@(list-rest a))
>    a])
> ```
>
> Expected behavior: return (list 1)
> Observed behavior: error, "a: unbound identifier in module"
>
> --
> William J. Bowman
> Northeastern University
> College of Computer and Information Science
>
> --
> 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 [email protected].
> 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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to