Browse thread
pattern matching and records vs tuples
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: | 2009-04-15 (07:41) |
From: | blue storm <bluestorm.dylc@g...> |
Subject: | Re: [Caml-list] pattern matching and records vs tuples |
On Wed, Apr 15, 2009 at 2:44 AM, Yaron Minsky <yminsky@gmail.com> wrote: > Another thought I've had for making record matches lighter is to do the same > kind of trick that's done with labeled arguments, i.e., have > > let { foo; bar } = x > > bind the variable foo to the x.foo, and bind bar to x.bar. That part is achieved by the pa_records [1] syntax extension. To my knowledge, it has not been port to post-3.10 camlp4 yet, but if you're interested, I could probably do it. [1] http://oandrieu.nerim.net/ocaml/#pa_records