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/

_______________________________________________
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

Reply via email to