Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005883OCamldocumentationpublic2013-01-10 07:202018-04-24 23:50
Assigned Togarrigue 
PrioritynormalSeverityminorReproducibilityhave not tried
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: [^]
TagsNo tags attached.
Attached Files

- Relationships
related to 0007783assignedoctachron Better explanation of multi-argument vs. tuple constructors in sum types 

-  Notes
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.
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
2017-02-23 16:35 doligez Category OCaml documentation => Documentation
2017-02-23 16:44 doligez Category Documentation => documentation
2018-04-24 23:50 octachron Relationship added related to 0007783

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker