Version franÁaise
Home ††† About ††† Download ††† Resources ††† Contact us †††
Browse thread
[Caml-list] two unrelated questions
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: JudicaŽl Courant <Judicael.Courant@l...>
Subject: Re: [Caml-list] two unrelated questions
Hi,

On Wed, 25 Apr 2001 20:38:43 -0400 (EDT) Patrick M Doane wrote:
> 
> One way to think about exceptions is to treat them simply as control
flow
> expressions. For example, the 'break' statement is used in C/C++ to
> early-out of iteration constructs. This translates naturally to
> exceptions:
> 
>   exception Break
>   try
>     List.iter (fun ..  -> ...  raise Break) l
>   with Break -> ()
> 

Actually there is already such a predefined exception in the core library
of O'Caml. The doc says:

-------------------------------------------------------------------
exception Exit

     This exception is not raised by any library function. It is provided
for use in your programs. 
-------------------------------------------------------------------

JudicaŽl.
-- 
Judicael.Courant@lri.fr, http://www.lri.fr/~jcourant/
(+33) (0)1 69 15 64 85
"Montre moi des morceaux de ton monde, et je te montrerai le mien"
Tim, matricule #929, condamnť ŗ mort.
http://rozenn.picard.free.fr/tim.html

-------------------
To unsubscribe, mail caml-list-request@inria.fr.  Archives: http://caml.inria.fr