[plt-scheme] ocaml-style match

From: Chongkai Zhu (czhu at cs.utah.edu)
Date: Mon Apr 5 17:23:32 EDT 2010

Why not just use:

(match '(1 2 3 4)
  [(list-rest a b c)

Chongkai

Jon Rafkind wrote:
> Here is `list-match' which gives you ocaml-style matching.
>
> (list-match '(1 2 3 4)
>   [(a :: b :: c) (and
>                    (equal? a 1)
>                    (equal? b 2)
>                    (equal? c '(3 4)))])
>
> More examples in the implementation.
> ------------------------------------------------------------------------
>
> _________________________________________________
>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme



Posted on the users mailing list.