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 QAA19313; Tue, 14 Oct 2003 16:48:39 +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 QAA27474 for ; Tue, 14 Oct 2003 16:48:38 +0200 (MET DST) Received: from megs23.100mwh.com ([205.214.86.13]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h9EEmb101535 for ; Tue, 14 Oct 2003 16:48:37 +0200 (MET DST) Received: from [205.214.86.158] (helo=uaapc442) by megs23.100mwh.com with asmtp (Exim 4.24) id 1A9QTN-0004If-Qr; Tue, 14 Oct 2003 08:48:30 -0600 To: =?utf-8?Q?Guillaume_Ch=C3=A2telet?= Cc: caml-list@inria.fr Subject: Re: [Caml-list] polymorphism and try References: Message-ID: From: Artem Prisyznuk Content-Type: text/plain; format=flowed; charset=utf-8 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Date: Tue, 14 Oct 2003 17:49:09 +0200 In-Reply-To: User-Agent: Opera7.20/Win32 M2 build 3087 X-MailScanner-Information: Please contact the ISP for more information X-MailScanner: Found to be clean X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - megs23.100mwh.com X-AntiAbuse: Original Domain - inria.fr X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - sit.kiev.ua X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 artem:01 guillaume:01 guillaume:01 artem:01 0200,:01 exception:02 wrote:03 oct:03 let:04 let:04 array:04 array:04 raise:05 raise:05 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Tue, 14 Oct 2003 15:17:12 +0200, Guillaume Châtelet wrote: > # let my_try f = try f with e -> raise e ;; This exception never raised, because you not call function f, but only return it as result of my_try. For your purpose possible next code: let my_try f = try f () with e -> raise e;; let id = fun x -> x;; let my_id a = my_try (fun () -> id a);; let my_array_get a b c = my_try (fun () -> Array.get a b c));; -- Artem Prysyznuk tema@sit.kiev.ua ------------------- 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