Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] failwith, raise and type inference
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-04-02 (20:28)
From: Pierre Weis <pierre.weis@i...>
Subject: Re: [Caml-list] failwith, raise and type inference
> Admitedly caml syntax is not very  beginner friendly.
> But the observed parsing has some internal logics.
> On usualy understand that  f x + y is in fact  (f x) + y
> But here, with failwith being a ``special'' function and ^ a ``special''
> operator, well...

That could be part of the problem: failwith is not ``special'' nor is ^,
hence the regular treatment of f x ^ y as (f x) ^ y and failwith x ^ y
as (failwith x) ^ y.

Operator precedence in Caml has been carefully crafted, you should
have a look at the programming guide lines that gives some hints on the
internal logics of some parts of the parsing, in the section

   When to use parentheses within an expression

Best regards,

Pierre Weis

INRIA, Projet Cristal,,

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: