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=0.1 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id A8FC7BBC4 for ; Wed, 15 Apr 2009 11:34:08 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvQBAH9G5UlCbwQaZ2dsb2JhbACWEA0JBQcHEQS7TIN+Bg X-IronPort-AV: E=Sophos;i="4.40,191,1238968800"; d="scan'208";a="26277567" Received: from out2.smtp.messagingengine.com ([66.111.4.26]) by mail3-smtp-sop.national.inria.fr with ESMTP; 15 Apr 2009 11:34:07 +0200 Received: from compute2.internal (compute2.internal [10.202.2.42]) by out1.messagingengine.com (Postfix) with ESMTP id 5C3932ED709; Wed, 15 Apr 2009 05:34:06 -0400 (EDT) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute2.internal (MEProxy); Wed, 15 Apr 2009 05:34:06 -0400 X-Sasl-enc: g0XMd/EfVYnLbs7xSWcAw6u+KDjFb1xR9pROupWTcy2q 1239788045 Received: from [192.168.1.10] (ALyon-157-1-93-31.w90-41.abo.wanadoo.fr [90.41.76.31]) by mail.messagingengine.com (Postfix) with ESMTPSA id 24B3D2AA69; Wed, 15 Apr 2009 05:34:05 -0400 (EDT) Message-ID: <49E5A930.4020508@ens-lyon.org> Date: Wed, 15 Apr 2009 11:30:24 +0200 From: Martin Jambon User-Agent: Thunderbird 2.0.0.17 (X11/20081008) MIME-Version: 1.0 To: blue storm Cc: yminsky@gmail.com, caml-list@inria.fr, gildor@ocamlcore.org, Alan Schmitt , serge.leblanc@wanadoo.fr Subject: Re: [Caml-list] pattern matching and records vs tuples References: <87skkbuxx8.fsf@aryx.cs.uiuc.edu> <891bd3390904141744k4516f3d0y551f6c572ccadad5@mail.gmail.com> <527cf6bc0904150041u7fa9e30dt3c5b5b8b0ab67ebf@mail.gmail.com> In-Reply-To: <527cf6bc0904150041u7fa9e30dt3c5b5b8b0ab67ebf@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; ens-lyon:01 yaron:01 minsky:01 yminsky:01 foo:01 foo:01 syntax:01 post-:01 camlp:01 oandrieu:01 ocaml:01 ocaml:01 storm:98 2009:98 2009:98 blue storm wrote: > On Wed, Apr 15, 2009 at 2:44 AM, Yaron Minsky 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 It's in the works for the next release of OCaml, according to Xavier Leroy's talk at the OCaml meeting in Grenoble (Feb 2009). (Note to organizers: slides and video would be cool!) Martin -- http://mjambon.com/