OCaml intentionally does not specify the evaluation order of functions and their arguments. The current implementation uses the anti-texual order (at least in most cases). It is technically possible that it will one day adopt the textual order used by Standard ML. Relevant text in the manual: https://v2.ocaml.org/manual/expr.html#sss:expr-functions-application
The same code will raise the other exception in any languages using the textual order. For example, the following code will raise B in Standard ML:
exception A
exception B
val _ : int = (raise B) (raise A)
This PR attempts to restore correctness with minimum changes. Again, thanks for the textbook.
OCaml intentionally does not specify the evaluation order of functions and their arguments. The current implementation uses the anti-texual order (at least in most cases). It is technically possible that it will one day adopt the textual order used by Standard ML. Relevant text in the manual: https://v2.ocaml.org/manual/expr.html#sss:expr-functions-application
The same code will raise the other exception in any languages using the textual order. For example, the following code will raise B in Standard ML:
This PR attempts to restore correctness with minimum changes. Again, thanks for the textbook.