Le Tuesday 03 Jan 2012 à 04:12:43 (-0800), DelPhiNus a écrit :
>
> But I am a bit frustrated by the poor level of the compilation error
> messages... It is quite hard to find the original problem and this is
> certainly due to the fact that Ocaml is not a verbose language.
>
> Anyway, consider the following code that is incorrect:
> let a () =
> let p = 1;
> let a = 2;
> 3;;
>
> Ocaml gives an error message at the last "end", ")" or ";;" token.
> Here at line 4.
> I think that Ocaml should report the error earlier when there is a let
> assignment immediately followed by a semi-colon.
Given that
let a () = let p = 1; 2 in 3
is valid OCaml, I do not see why the parser should choke on the
semicolon.
Conversely, choking on the semicolon would mean changing the language
itself. That's quite a different thing from poor error reporting.
> Regards,
> Delphin
--
Guillaume Yziquel
http://yziquel.homelinux.org
--
You received this message because you are subscribed to the Google Groups
"ocaml-developer" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/ocaml-developer?hl=en
For other OCaml forums, see http://caml.inria.fr/resources/forums.en.html