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: 1631 Reporter: administrator Status: closed Resolution: fixed Priority: normal Severity: minor Category: ~DO NOT USE (was: OCaml general)
Bug description
The precedence chart at http://caml.inria.fr/ocaml/htmlman/manual015.html says that "=" binds
more tightly than "not" in the same sense that "*" binds more tightly
than "+". The implementation disagrees:
not 3 = 4;;
Characters 4-5:
not 3 = 4;;
^
This expression has type int but is here used with type bool
I like the documented behavior better than the implemented behavior.
I think this would be a compatible change, except in the presence of
perverse redefinitions of not:
let not x = true;;
val not : 'a -> bool =
not true = false;;
: bool = false
(not true) = false;;
: bool = false
not (true = false);;
: bool = true
Changing the implementation to be consistent with the documentation
would be almost compatible because if "(not x) = y" typechecks and not
means boolean negation, then "(not x) = y" is the same as
"not (x = y)".
--
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:
Original bug ID: 1631
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)
Bug description
The precedence chart at
http://caml.inria.fr/ocaml/htmlman/manual015.html says that "=" binds
more tightly than "not" in the same sense that "*" binds more tightly
than "+". The implementation disagrees:
not 3 = 4;;
Characters 4-5:
not 3 = 4;;
^
This expression has type int but is here used with type bool
I like the documented behavior better than the implemented behavior.
I think this would be a compatible change, except in the presence of
perverse redefinitions of not:
let not x = true;;
val not : 'a -> bool =
not true = false;;
(not true) = false;;
not (true = false);;
Changing the implementation to be consistent with the documentation
would be almost compatible because if "(not x) = y" typechecks and not
means boolean negation, then "(not x) = y" is the same as
"not (x = y)".
--
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: