Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: "Yaron Minsky" <yminsky@cs.cornell.edu>
To: "Olivier Andrieu" <oandrieu@gmail.com>
Cc: "Yitzhak Mandelbaum" <yitzhak@research.att.com>,
	caml-list@yquem.inria.fr
Subject: Re: [Caml-list] "opening" record types
Date: Tue, 21 Aug 2007 18:19:56 -0400	[thread overview]
Message-ID: <891bd3390708211519r14ed1c58rb7b3a8e426d1216a@mail.gmail.com> (raw)
In-Reply-To: <95513600708210634q236768efjbfda6cd844e498c1@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 504 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 1311 bytes --]

  reply	other threads:[~2007-08-21 22:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-21 13:18 Yitzhak Mandelbaum
2007-08-21 13:34 ` [Caml-list] " Olivier Andrieu
2007-08-21 22:19   ` Yaron Minsky [this message]
2007-08-21 13:42 ` Christophe TROESTLER
2007-08-21 13:55   ` Daniel de Rauglaudre
2007-08-21 13:47 ` Virgile Prevosto
2007-08-22 16:32 ` Philippe Wang
2007-08-22 19:24   ` Jeremy Yallop

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=891bd3390708211519r14ed1c58rb7b3a8e426d1216a@mail.gmail.com \
    --to=yminsky@cs.cornell.edu \
    --cc=caml-list@yquem.inria.fr \
    --cc=oandrieu@gmail.com \
    --cc=yitzhak@research.att.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox