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 WAA25723; Tue, 21 Oct 2003 22:53:04 +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 WAA30613 for ; Tue, 21 Oct 2003 22:53:03 +0200 (MET DST) Received: from fallback01.mail.atl.earthlink.net (fallback01.mail.atl.earthlink.net [207.69.200.240]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h9LKr2119539 for ; Tue, 21 Oct 2003 22:53:02 +0200 (MET DST) Received: from hall.mail.mindspring.net (hall.mail.mindspring.net [207.69.200.60]) by fallback01.mail.atl.earthlink.net (8.11.7+Sun/8.11.6) with ESMTP id h9LKYWl08345 for ; Tue, 21 Oct 2003 16:34:32 -0400 (EDT) Received: from user-0ccekej.cable.mindspring.com ([24.199.81.211] helo=minsky-primus.homeip.net) by hall.mail.mindspring.net with smtp (Exim 3.33 #1) id 1AC3B5-0007MS-00 for caml-list@inria.fr; Tue, 21 Oct 2003 16:32:27 -0400 Received: from 141.155.88.179 (SquirrelMail authenticated user yminsky) by minsky-primus.homeip.net with HTTP; Tue, 21 Oct 2003 16:32:27 -0400 (EDT) Message-ID: <49133.141.155.88.179.1066768347.squirrel@minsky-primus.homeip.net> In-Reply-To: <20031021175006.GA9314@redhat.com> References: <20031021142921.GA6736@redhat.com> <20031021145531.GA14086@roke.freak> <20031021172812.GA26066@force.stwing.upenn.edu> <20031021175006.GA9314@redhat.com> Date: Tue, 21 Oct 2003 16:32:27 -0400 (EDT) Subject: Re: [Caml-list] OCaml wishlist From: "Yaron Minsky" To: caml-list@inria.fr User-Agent: SquirrelMail/1.4.2-1 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 Importance: Normal X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 wishlist:01 yaron:01 minsky:01 yminsky:01 cornell:01 camlp:01 bug:01 ocaml:01 match:02 exception:02 messy:03 let:04 let:04 raise:05 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk This seems pretty easy to achieve, although it's a bit messy. Seems like you might be able to clean it up with camlp4. Here's the basic idea: exception Return let f ... = let rval = ref None in try .... rval := Some ...; raise Return .... with Return -> match rval with None -> "Bug! function ended without returning" | Some x -> x ------------------- 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