Browse thread
"opening" record types
[
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: | 2007-08-21 (22:20) |
From: | Yaron Minsky <yminsky@c...> |
Subject: | Re: [Caml-list] "opening" record types |
On 8/21/07, Olivier Andrieu <oandrieu@gmail.com> wrote: > actually, you can write > let y = {Foo.a=3; b=4} > > i.e. you only need the module name on one field of the record, not all Indeed, at Jane Street, we've come to favor the following idiom: let y = { Module_name. field1 = val1; field2 = val2; ... } The module name then works almost like a constructor, so you hardly need the syntax extension discussed elsewhere in this thread. y