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 PAA28985; Fri, 2 Apr 2004 15:52:21 +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 PAA29187 for ; Fri, 2 Apr 2004 15:52:20 +0200 (MET DST) X-SPAM-Warning: Sending machine is listed in blackholes.five-ten-sg.com Received: from postfix3-2.free.fr (postfix3-2.free.fr [213.228.0.169]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i32DqJYM009248 for ; Fri, 2 Apr 2004 15:52:19 +0200 Received: from warp (lns-th2-5f-81-56-197-80.adsl.proxad.net [81.56.197.80]) by postfix3-2.free.fr (Postfix) with SMTP id 607E8C143; Fri, 2 Apr 2004 15:52:19 +0200 (CEST) Message-ID: <00ab01c418b9$9ab8b870$ef01a8c0@warp> From: "Nicolas Cannasse" To: , "Paul Guyot" References: Subject: Re: [Caml-list] failwith, raise and type inference Date: Fri, 2 Apr 2004 15:51:31 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 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; cannasse:01 warplayer:01 caml-list:01 failwith:01 inference:01 failwith:01 avalue:01 avalue:01 cannasse:01 dict:01 dict:01 nicolas:01 nicolas:01 rec:01 match:02 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk X-Keywords: X-UID: 30 > >let rec f1 key dict = > > match dict with > > [] -> failwith "The key " ^ key ^ " could not be found" > > | (aKey, aValue)::tail -> > > if (aKey = key) > > then aValue > > else f1 key tail;; The tip is here : failwith "The key " ^ key ^ " could not be found" is actually equivalent to : (failwith "The key ") ^ key ^ " could not be found" and different from (what you were thinking) : failwith ("The key " ^ key ^ " could not be found") Regards, Nicolas Cannasse ------------------- 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