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: 1642 Reporter: administrator Status: closed Resolution: not a bug Priority: normal Severity: minor Category: ~DO NOT USE (was: OCaml general)
Bug description
"match 3 with _ -> 3" is an expression, and "f" is an expression, so
according to the documented grammar "f match 3 with _ -> 3" should be
an expression. The implementation forces me to parenthesize the match:
let f x = x;;
val f : 'a -> 'a =
f match 3 with _ -> 3;;
Characters 2-7:
f match 3 with _ -> 3;;
^^^^^
Syntax error
f (match 3 with _ -> 3);;
: int = 3
--
Tim Freeman tim@fungible.com
Which is worse: ignorance or apathy? Who knows? Who cares?
GPG public key fingerprint ECDF 46F8 3B80 BB9E 575D 7180 76DF FE00 34B1 5C78
The text was updated successfully, but these errors were encountered:
The reference manual doesn't contain a full grammar of the language, more like
an AST definition using concrete syntax and precedence hints. Note that the
precedence table says that function application binds tighter than "match",
hence the fact that the "match" must be parenthesized is somewhat documented.
-XL, 2003-08-20
Original bug ID: 1642
Reporter: administrator
Status: closed
Resolution: not a bug
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)
Bug description
"match 3 with _ -> 3" is an expression, and "f" is an expression, so
according to the documented grammar "f match 3 with _ -> 3" should be
an expression. The implementation forces me to parenthesize the match:
let f x = x;;
val f : 'a -> 'a =
f match 3 with _ -> 3;;
Characters 2-7:
f match 3 with _ -> 3;;
^^^^^
Syntax error
f (match 3 with _ -> 3);;
--
Tim Freeman tim@fungible.com
Which is worse: ignorance or apathy? Who knows? Who cares?
GPG public key fingerprint ECDF 46F8 3B80 BB9E 575D 7180 76DF FE00 34B1 5C78
The text was updated successfully, but these errors were encountered: