From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id E69CBBC57; Thu, 24 Jun 2010 19:45:23 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApsBAD82I0xCbwQakWdsb2JhbACTCYwuFQEBAQEJCwoHEQQewjsFhSGDYg X-IronPort-AV: E=Sophos;i="4.53,475,1272837600"; d="scan'208";a="53849490" Received: from out2.smtp.messagingengine.com ([66.111.4.26]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/ADH-AES256-SHA; 24 Jun 2010 19:45:23 +0200 Received: from compute2.internal (compute2.internal [10.202.2.42]) by gateway1.messagingengine.com (Postfix) with ESMTP id 46756103C90; Thu, 24 Jun 2010 13:45:22 -0400 (EDT) Received: from heartbeat1.messagingengine.com ([10.202.2.160]) by compute2.internal (MEProxy); Thu, 24 Jun 2010 13:45:22 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=messagingengine.com; h=message-id:date:from:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding; s=smtpout; bh=pjVAdXp9UsaMdLIywv3DFOV5noM=; b=dqhMjzzBa3Lhbv88GeC04U2A6vRJu1ciZJ14mXW76TPxi9s4zn9UJUk/q0qnWVDzMoOzUPCejY0HDWn+PtumWG94rpXdgSgN2OGCje78LmNmuOJR4wvngRxeQTmCjD/wFuUPr4lOUUk2aWqvLSZ5//qaS1YeVnDnU85Tfj9iSh8= X-Sasl-enc: uxQAixT0iknpxIhjsEnxQHgA0ApWSCqvGwHDk0KzORr3 1277401521 Received: from [192.168.1.61] (64-71-1-162.static.wiline.com [64.71.1.162]) by mail.messagingengine.com (Postfix) with ESMTPSA id A95D84E2E22; Thu, 24 Jun 2010 13:45:21 -0400 (EDT) Message-ID: <4C2399B0.4060503@ens-lyon.org> Date: Thu, 24 Jun 2010 10:45:20 -0700 From: Martin Jambon User-Agent: Thunderbird 2.0.0.22 (X11/20090908) MIME-Version: 1.0 To: florent.ouchet@imag.fr Cc: Damien Doligez , caml users Subject: Re: [Caml-list] OCaml 3.12.0+beta1 References: <4C232778.2020605@imag.fr> In-Reply-To: <4C232778.2020605@imag.fr> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Spam: no; 0.00; ens-lyon:01 ocaml:01 damien:01 lbl:01 ocaml:01 syntax:01 nodes:01 doligez:01 wrote:01 compile:01 pat:01 caml-list:01 tuples:01 tuples:01 jambon:01 Florent Ouchet wrote: > Hello, > > No problem so far with 3.12.0b1 but... > > Damien Doligez a écrit : >> - Record patterns of the form { lbl = pat; _ } to mark that not all >> labels are listed, purposefully. (See new warning below.) >> > This modification heavily breaks backward compatibility with OCaml 3.11. > You should provide some preprocessing scripts to strip these extra "_". I disagree. The syntax is a new and optional feature. Authors who want their new code to compile with an earlier version of OCaml should simply avoid using the new feature, as always. Finally we'll be able to use pattern matching on records for real and it's really cool. That means we can use records where we used to prefer tuples, typically on things like tree nodes. It will make it easier to add fields when the code evolves, compared to tuples. Tuple version: let loc, _, _, name, _ = x in ... Record version: let { loc; name; _ } = x in ... Old record version: let { loc = loc; name = name } = x in ... Martin -- http://mjambon.com/