Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005883OCamlOCaml documentationpublic2013-01-10 07:202013-01-17 04:12
Reporternorm 
Assigned Togarrigue 
PrioritynormalSeverityminorReproducibilityhave not tried
StatusclosedResolutionfixed 
PlatformMacOSOS XOS Version10.7.5
Product Version4.00.1 
Target VersionFixed in Version4.01.0+dev 
Summary0005883: BNF insufficient for S (3, 4)
DescriptionThe 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 InformationFor prettier text and soap box see:
http://cap-lore.com/Languages/ocaml/bugs/e.html [^]
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0008733)
garrigue (manager)
2013-01-10 08:16

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.
(0008764)
garrigue (manager)
2013-01-17 04:12

Fixed the manual at revision 13254.
(Did not change the BNF, just the explanation)

- Issue History
Date Modified Username Field Change
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
Powered by Mantis Bugtracker