You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 5883 Reporter: norm Assigned to:@garrigue Status: closed (set by @garrigue on 2013-01-17T03:12:31Z) Resolution: fixed Priority: normal Severity: minor Platform: Mac OS: OS X OS Version: 10.7.5 Version: 4.00.1 Fixed in version: 4.01.0+dev Category: documentation Related to:#7783
Bug 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.
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.
Original bug ID: 5883
Reporter: norm
Assigned to: @garrigue
Status: closed (set by @garrigue on 2013-01-17T03:12:31Z)
Resolution: fixed
Priority: normal
Severity: minor
Platform: Mac
OS: OS X
OS Version: 10.7.5
Version: 4.00.1
Fixed in version: 4.01.0+dev
Category: documentation
Related to: #7783
Bug 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:
http://cap-lore.com/Languages/ocaml/bugs/e.html
The text was updated successfully, but these errors were encountered: