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 TAA00567; Tue, 1 Jun 2004 19:14:01 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id TAA04704 for ; Tue, 1 Jun 2004 19:14:00 +0200 (MET DST) X-SPAM-Warning: Sending machine is listed in blackholes.five-ten-sg.com Received: from gatekeeper.elmer.external.excelhustler.com (gatekeeper.excelhustler.com [68.99.114.105]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i51HDwEV016328 for ; Tue, 1 Jun 2004 19:13:59 +0200 Received: from chatterbox.elmer.internal.excelhustler.com (unknown [192.168.0.12]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (Client CN "chatterbox.elmer.internal.excelhustler.com", Issuer "excelhustler.com" (not verified)) by gatekeeper.elmer.external.excelhustler.com (Postfix) with ESMTP id 17598E0109; Tue, 1 Jun 2004 12:13:57 -0500 (CDT) Received: from localhost (localhost [127.0.0.1]) by chatterbox.elmer.internal.excelhustler.com (Postfix) with ESMTP id D5E865C063; Tue, 1 Jun 2004 12:13:56 -0500 (CDT) Received: from chatterbox.elmer.internal.excelhustler.com ([192.168.0.12]) by localhost (chatterbox [192.168.0.12]) (amavisd-new, port 10025) with ESMTP id 27650-03; Tue, 1 Jun 2004 12:13:54 -0500 (CDT) Received: from wile.internal.excelhustler.com (wile.internal.excelhustler.com [192.168.1.34]) by chatterbox.elmer.internal.excelhustler.com (Postfix) with ESMTP id 9A6405C00B; Tue, 1 Jun 2004 12:13:54 -0500 (CDT) Received: by wile.internal.excelhustler.com (Postfix, from userid 1000) id 87BD147012; Tue, 1 Jun 2004 12:13:54 -0500 (CDT) Date: Tue, 1 Jun 2004 12:13:54 -0500 From: John Goerzen To: caml-list@inria.fr Subject: [Caml-list] Strange syntax behavior Message-ID: <20040601171354.GA16495@excelhustler.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.6i X-Virus-Scanned: by amavisd-new-20030616-p7 (Debian) at excelhustler.com X-Miltered: at nez-perce with ID 40BCB956.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; endline:01 bug:01 misleading:01 syntax:02 unit:03 unit:03 behavior:03 behavior:03 let:04 raise:05 seems:05 clause:05 clause:05 feature:07 feature:07 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hello, I have found some mysterious bugs in a couple of my programs. Here is a test case to illustrate what is going on: # let p = print_endline;; # if true then p "yes" else p "no"; p "done";; yes done - : unit = () # try p "test" with Not_found -> p "exc"; p "done";; test - : unit = () # try raise Not_found with Not_found -> p "exc"; p "done";; exc done - : unit = () # try p "test" with Not_found -> begin p "exc"; end; p "done";; test - : unit = () In the case of if...then...else, the else clause appears to consume only the first statement following. With try..with, the with clause appears to consume everything it possibly can, despite even attempts to stop that with a begin..end clause. Is this a bug or a feature? If a feature, why is this so? the try..with behavior seems highly misleading. -- John ------------------- 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