From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id WAA21769; Fri, 2 Apr 2004 22:28:13 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id WAA21044 for ; Fri, 2 Apr 2004 22:28:10 +0200 (MET DST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i32KS7YM028740; Fri, 2 Apr 2004 22:28:07 +0200 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id WAA20083; Fri, 2 Apr 2004 22:28:06 +0200 (MET DST) From: Pierre Weis Message-Id: <200404022028.WAA20083@pauillac.inria.fr> Subject: Re: [Caml-list] failwith, raise and type inference In-Reply-To: <20040402160514.A29362@beaune.inria.fr> from Luc Maranget at "Apr 2, 104 04:09:48 pm" To: Luc.Maranget@inria.fr (Luc Maranget) Date: Fri, 2 Apr 2004 22:28:06 +0200 (MET DST) Cc: pguyot@kallisys.net, caml-list@inria.fr X-Mailer: ELM [version 2.4ME+ PL28 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Miltered: at concorde by Joe's j-chkmail ("http://j-chkmail.ensmp.fr")! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; pierre:01 weis:01 pierre:01 weis:01 caml-list:01 failwith:01 inference:01 logics:01 failwith:01 logics:01 parentheses:01 cristal:01 caml:01 caml:01 syntax:02 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk X-Keywords: X-UID: 35 [...] > 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, Pierre.Weis@inria.fr, http://pauillac.inria.fr/~weis/ ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners