Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Martin Jambon <martin.jambon@ens-lyon.org>
To: florent.ouchet@imag.fr
Cc: Damien Doligez <damien.doligez@inria.fr>,
	caml users <caml-list@inria.fr>
Subject: Re: [Caml-list] OCaml 3.12.0+beta1
Date: Thu, 24 Jun 2010 10:45:20 -0700	[thread overview]
Message-ID: <4C2399B0.4060503@ens-lyon.org> (raw)
In-Reply-To: <4C232778.2020605@imag.fr>

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/


  reply	other threads:[~2010-06-24 17:45 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-16 13:07 Damien Doligez
2010-06-16 16:28 ` [Caml-list] " Yoann Padioleau
2010-06-16 18:40   ` Martin Jambon
2010-06-16 20:52 ` Török Edwin
2010-06-17 13:35   ` xclerc
2010-06-18 14:56     ` xclerc
2010-06-19  5:51 ` Stéphane Glondu
2010-06-24  9:38 ` Florent Ouchet
2010-06-24 17:45   ` Martin Jambon [this message]
2010-06-24 18:59     ` Florent.Ouchet
2010-06-24 19:29       ` Dmitry Bely
2010-06-24 19:31       ` Mathias Kende
2010-06-24 19:39       ` Till Varoquaux
2010-06-24 20:49         ` Florent Ouchet
2010-06-24 20:57           ` Hezekiah M. Carty
2010-06-24 22:05             ` Florent Ouchet
2010-06-25  5:54               ` bluestorm
2010-06-25  6:24                 ` Florent Ouchet
2010-06-25  8:17                   ` bluestorm
2010-06-25  8:48                     ` David Allsopp
2010-06-25  9:35                       ` bluestorm
2010-06-25  7:29 ` bluestorm

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=4C2399B0.4060503@ens-lyon.org \
    --to=martin.jambon@ens-lyon.org \
    --cc=caml-list@inria.fr \
    --cc=damien.doligez@inria.fr \
    --cc=florent.ouchet@imag.fr \
    /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