Impressive!
By the way, one of the most common mistakes is to forget that a function application binds tighter thaninfix operators, e.g.,
# print_int 2+2;;
Although your branch already provides a nice error message:
Error: The function `+' cannot be applied to the arguments provided.
| Types of the expected arguments: | Types of the provided arguments:---|-------------------------------------|------------------------------------1 | int | unit2 | int | int
that is probably better than the default:
it is still probably a good idea, to provide an ad-hoc error message here (as you did for missing `()`, `!` and `rec`).Error: This expression has type unit but an expression was expected of typeint
In this case, if an offending expression contains a binary operator which has an application to the left and some simpl_expron the right, and if we can fix it by parenthesizing the expression, then we can suggest adding parentheses around the expression.
Regards,Ivan Gotovchits
On Thu, Jan 12, 2017 at 4:37 PM, SP <sp@orbitalfox.com> wrote:
Nice!
--
SP
--
Caml-list mailing list. Subscription management and archives:
https://sympa.inria.fr/sympa/arc/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs