[wg-camlp4] About the "bool" argument fo Ppat_construct and Pexp_construct
Alain Frisch
alain.frisch at lexifi.com
Fri Apr 12 17:51:30 BST 2013
Dear all,
The Ppat_construct and Pexp_construct constructors in Parsetree have a
"bool" argument supposed to encode the fact that if the argument is a
tuple of length N, then it actually represents the N arguments of an
N-ary constructor, so that it won't type-check if the constructor is
declared with a single argument being a N-tuple type. (In the normal
OCaml syntax, this cannot be distinguished.)
I believe this was introduced to give better error messages with Camlp4
revised syntax, but the behavior seems to be disabled by default (can
anyone confirm?) and I don't see how to enable it. The following is
accepted if we compile with camlp4:
=======================================
type t = [C of (int * int)];
value f = fun [ C x y -> x + y ];
=======================================
and I believe rejecting this was the reason to introduce the Boolean.
Does anyone object to removing the Boolean?
Alain
More information about the wg-camlp4
mailing list