[racket] as-patterns?

From: Eric Tanter (etanter at dcc.uchile.cl)
Date: Mon Sep 2 15:31:00 EDT 2013

arff.. so obvious and neat. Thanks!

-- Éric


On Sep 2, 2013, at 3:28 PM, Carl Eastlund <cce at ccs.neu.edu> wrote:

> Eric, use an "and" pattern.
> 
> (and elem (cons a b))
> 
> Carl Eastlund
> 
> 
> On Mon, Sep 2, 2013 at 3:24 PM, Eric Tanter <etanter at 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 at 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
> 
> 



Posted on the users mailing list.