From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.2 required=5.0 tests=AWL,HTML_MESSAGE,SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id C4D34BC6B for ; Wed, 22 Aug 2007 00:19:59 +0200 (CEST) Received: from nz-out-0506.google.com (nz-out-0506.google.com [64.233.162.225]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l7LMJwQc006545 for ; Wed, 22 Aug 2007 00:19:59 +0200 Received: by nz-out-0506.google.com with SMTP id x7so647443nzc for ; Tue, 21 Aug 2007 15:19:58 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:references:x-google-sender-auth; b=eIwCu0Z7KFZSknRWpgIaNxTeRYWRXjqMkBBmprz24JZToTdL2gOTA0VniLLNKRjjXV0cDt/XmZ1MDHPw7k+l9C4F8dUJiZS+TSD8mD4LdJI08CMlZpiW1w+c4FNdEBqbTQ0QP3uSF8r7geTStO8H5ss8LcnMjo/C++GrpFP/37Y= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:references:x-google-sender-auth; b=N8DaW7mRYLMzsomnw5n991qoz8qX/L/HTJsEVAGaoKsTW33ggq/piVOPvL7gs+kRYxDSuKvMfMIUpJBuCSaVmvSm2JTRbKA/2JPzMFoIYeHsB4O0vxbCCjQgLcdJJ/6Ug2bRJSQn7N1yug26ag2QVc403H5ku/9aEqHLqR1V0ZI= Received: by 10.142.51.4 with SMTP id y4mr1127986wfy.1187734796648; Tue, 21 Aug 2007 15:19:56 -0700 (PDT) Received: by 10.142.231.14 with HTTP; Tue, 21 Aug 2007 15:19:56 -0700 (PDT) Message-ID: <891bd3390708211519r14ed1c58rb7b3a8e426d1216a@mail.gmail.com> Date: Tue, 21 Aug 2007 18:19:56 -0400 From: "Yaron Minsky" Sender: yminsky@gmail.com To: "Olivier Andrieu" Subject: Re: [Caml-list] "opening" record types Cc: "Yitzhak Mandelbaum" , caml-list@yquem.inria.fr In-Reply-To: <95513600708210634q236768efjbfda6cd844e498c1@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_1671_27922443.1187734796595" References: <67ECB685-E69A-43CA-867D-30B879DB0510@research.att.com> <95513600708210634q236768efjbfda6cd844e498c1@mail.gmail.com> X-Google-Sender-Auth: 64237a5563dc764c X-Miltered: at concorde with ID 46CB650E.004 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; yaron:01 minsky:01 yminsky:01 andrieu:01 oandrieu:01 foo:01 val:01 val:01 syntax:01 andrieu:01 oandrieu:01 foo:01 syntax:01 idiom:01 idiom:01 ------=_Part_1671_27922443.1187734796595 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline On 8/21/07, Olivier Andrieu 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 ------=_Part_1671_27922443.1187734796595 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline 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


------=_Part_1671_27922443.1187734796595--