|Anonymous | Login | Signup for a new account||2015-01-29 15:29 CET|
|Main | My View | View Issues | Change Log | Roadmap|
|View Issue Details|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0005883||OCaml||OCaml documentation||public||2013-01-10 07:20||2013-01-17 04:12|
|Priority||normal||Severity||minor||Reproducibility||have not tried|
|Platform||Mac||OS||OS X||OS Version||10.7.5|
|Target Version||Fixed in Version||4.01.0+dev|
|Summary||0005883: BNF insufficient for S (3, 4)|
|Description||The syntax does not seem to produce the expression “S (3, 4)” in the context of the declaration “type w = S of int * int”. The rule: expr ::= constr expr might suggest that expr could be a tuple, but then “let u = 4, 8 in S u” should be legal but ocaml 4.00.1 rejects it.|
|Additional Information||For prettier text and soap box see:|
|Tags||No tags attached.|
Indeed, constructors have an arity, and you cannot apply them to tuples.
This is not a new behavior: this has been this way since caml-light, more than 20 years ago.
But you are right that the manual is not very explicit about that.
By the way, I think that the problem is not the production itself (which is about the parse,
which indeed accepts any expression there, but about the explanation, which should mention the fact that the number of parameters must match the arity of the constructor.
Fixed the manual at revision 13254.
(Did not change the BNF, just the explanation)
|2013-01-10 07:20||norm||New Issue|
|2013-01-10 08:16||garrigue||Note Added: 0008733|
|2013-01-10 08:16||garrigue||Assigned To||=> garrigue|
|2013-01-10 08:16||garrigue||Status||new => acknowledged|
|2013-01-17 04:12||garrigue||Note Added: 0008764|
|2013-01-17 04:12||garrigue||Status||acknowledged => closed|
|2013-01-17 04:12||garrigue||Resolution||open => fixed|
|2013-01-17 04:12||garrigue||Fixed in Version||=> 4.01.0+dev|
|Copyright © 2000 - 2011 MantisBT Group|