Eric, use an "and" pattern.

(and elem (cons a b))

Carl Eastlund


On Mon, Sep 2, 2013 at 3:24 PM, Eric Tanter <etan...@dcc.uchile.cl> wrote:

> Hi,
>
> Is there a way to bind a name to a whole sub-value being matched in
> pattern?
>
> eg. like var@pat in Haskell:
> (match l
>   [(cons (@ elem (cons a b)) rest) ...elem...])
>
> It must be there somewhere, but I couldn't find it :/
>
> Thanks!
>
> -- Éric
>
> ____________________
>   Racket Users list:
>   http://lists.racket-lang.org/users
>
>
____________________
  Racket Users list:
  http://lists.racket-lang.org/users

Reply via email to