Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] assertions or exceptions?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Radu Grigore <radugrigore@g...>
Subject: Re: [Caml-list] assertions or exceptions?
On Thu, 15 Jul 2004 14:33:59 +0100, Richard Jones <rich@annexia.org> wrote:

> let valid_hostname r =
>   try ignore (Request.hostname r); true with Not_found -> false

Maybe Request.hostname is a bad example. In general you can provide a
query that is more efficient than actually trying to do it. The
example to which I linked in the previous email was about an OpenFile
method that can throw FileNotFound paired with FileExists that returns
a boolean. I'd bet FileExists is not implemented in terms of OpenFile.

I'll stop here since I'm a troll :-P

regards,
 radu

-------------------
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