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 LAA17219; Fri, 16 Nov 2001 11:18:55 +0100 (MET) Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id LAA17555 for caml-list@pauillac.inria.fr; Fri, 16 Nov 2001 11:18:54 +0100 (MET) 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 VAA10615 for ; Thu, 15 Nov 2001 21:42:02 +0100 (MET) Received: from kinsman.panasas.com (gw2.panasas.com [65.194.124.178]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id fAFKg1j16834 for ; Thu, 15 Nov 2001 21:42:01 +0100 (MET) Received: (from jprevost@localhost) by kinsman.panasas.com (8.11.3/8.11.3) id fAFKfsI39625; Thu, 15 Nov 2001 15:41:54 -0500 (EST) (envelope-from jprevost@panasas.com) X-Authentication-Warning: kinsman.panasas.com: jprevost set sender to jprevost@panasas.com using -f To: William Harold Newman Cc: caml-list@inria.fr Subject: Re: [Caml-list] queasiness about Exit References: <20011115093845.A26661@rootless> From: John Prevost Date: 15 Nov 2001 15:41:54 -0500 In-Reply-To: <20011115093845.A26661@rootless> Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk How about something like: let exists_in_complex_datastructure = let module M = struct exception Exit let eicd predicate complex_data_structure = try map_for_effect_on_complex_data_structure (fun element -> if predicate element then raise Exit) complex_data_structure; false with Exit -> true end in M.eicd That is, in the scope of your module (or within the function), create a new exception for your use. Since it's local to your function, nobody else will be raising it. John. ------------------- Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr