[plt-scheme] match-let bug or feature?

From: Derick Eddington (derick.eddington at gmail.com)
Date: Fri Jan 4 15:51:11 EST 2008

Welcome to MzScheme v3.99.0.8 [3m], Copyright (c) 2004-2008 PLT Scheme Inc.
> (require (lib "match.ss"))
> (match-let ([(a b) (list 1 2)]
              [(b a) (list 2 1)])
    (list a b))
(1 2)
> (match-let ([(a b) (list 1 2)]
              [(b a) (list 3 1)])
    (list a b))
match: no matching clause for ((1 2) (3 1))

 === context ===
/home/d/plt/collects/mzlib/private/match/match-error.ss:9:4: match:error

I'm leaning towards "bug" because for a normal `let' you can't have
duplicate identifiers, and the scope of the duplicate identifier feature
of match patterns is restricted to individual match clauses.  Though, I
can see how the way it is now could have interesting uses.

: Derick

Posted on the users mailing list.