I am fond of match-define too. The name is a little long, so I use this to
get shorter names:

(define-syntax defm (make-rename-transformer #'match-define))

(for/list ([a+b some-sequence])
    (defm (list a b) a+b)
    a)

Another construct with too long a name is define-values:

(define-syntax defv (make-rename-transformer #'define-values))

/Jens Axel

2013/9/3 Asumu Takikawa <as...@ccs.neu.edu>

> On 2013-09-03 11:32:23 +0200, Konrad Hinsen wrote:
> >   (for/list ([(list a b) some-sequence])
> >     a)
>
> I usually use `match-define`:
>
>   (for/list ([a+b some-sequence])
>     (match-define (list a b) a+b)
>     a)
>
> Can be slightly longer than just `match` for simple cases, but doesn't
> cause rightward drift.
>
> Cheers,
> Asumu
> ____________________
>   Racket Users list:
>   http://lists.racket-lang.org/users
>



-- 
-- 
Jens Axel Søgaard
____________________
  Racket Users list:
  http://lists.racket-lang.org/users

Reply via email to