New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
type expression for polymorphic variant with open matching #8414
Comments
Comment author: administrator
[...]
That's how it is in the implementation now. I regard this as a design bug.
The BNF grammar needs to be fixed.
Your reasoning is incorrect. ">|" is an identifier, and we obvioulsy cannot I have fixed the problem in the CVS tree by giving "[>" the same status as Thanks for your bug report, -- Damien |
Comment author: administrator ----- The following addresses had permanent fatal errors ----- ----- Transcript of session follows ----- Reporting-MTA: dns; concorde.inria.fr Final-Recipient: RFC822; peter@syncad.dot.com Return-Path: caml-bugs@pauillac.inria.fr
[...]
That's how it is in the implementation now. I regard this as a design bug.
The BNF grammar needs to be fixed.
Your reasoning is incorrect. ">|" is an identifier, and we obvioulsy cannot I have fixed the problem in the CVS tree by giving "[>" the same status as Thanks for your bug report, -- Damien |
Comment author: administrator implementation fixed --DD 2003-12-18 |
Original bug ID: 1978
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)
Bug description
Full_Name: Peter Hercek
Version: 3.07+2
OS: Linux
Submission from: ethernet-012-packplace.citizens.swva.net.66.37.66.in-addr.arpa (66.37.66.12)
Hi,
I checked it on Linux, but the behavior is the same on Windows with version
3.07.
This may be a documentation error and not an OCaml parser/lexer error. My report
is based on the pdf documentation for OCaml 3.07 (September 29, 2003).
Here is my test with OCaml console:
Objective Caml version 3.07+2
let f x:[<|
A|
B] = x;;val f : ([<
A |
B ] as 'a) -> 'a =let f x:[>|
A|
B] = x;;Syntax error
let f x:[> |
A|
B] = x;;#quit;;
It looks like the reason is that ">|" is a lexical symbol and "[>" is not a
lexical symbol.
Well, "[>" should not be lexical symbol based on the BNF grammar for
"variant-type" nonterminal. Uff, this reasoning is valid for "[<" too and "[<"
is a keyword (ie a lexical symbol). On the other side ">|" should not be a
lexical symbol, because there is no mention about in in the whole OCaml 3.07
manual.
Regards,
Peter.
The text was updated successfully, but these errors were encountered: