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 PAA27526; Thu, 15 Jul 2004 15:58:51 +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 PAA27560 for ; Thu, 15 Jul 2004 15:58:50 +0200 (MET DST) Received: from mproxy.gmail.com (mproxy.gmail.com [216.239.56.249]) by nez-perce.inria.fr (8.12.10/8.12.10) with SMTP id i6FDwmEV002300 for ; Thu, 15 Jul 2004 15:58:49 +0200 Received: by mproxy.gmail.com with SMTP id w29so1173478cwb for ; Thu, 15 Jul 2004 06:58:41 -0700 (PDT) Received: by 10.11.99.74 with SMTP id w74mr59048cwb; Thu, 15 Jul 2004 06:58:41 -0700 (PDT) Message-ID: <7f8e92aa040715065823a44bdf@mail.gmail.com> Date: Thu, 15 Jul 2004 16:58:41 +0300 From: Radu Grigore To: caml-list@inria.fr Subject: Re: [Caml-list] assertions or exceptions? In-Reply-To: <20040715133359.GA13273@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <7f8e92aa04071501035091cbe9@mail.gmail.com> <20040715101826.GA10062@redhat.com> <7f8e92aa04071505495315454@mail.gmail.com> <20040715133359.GA13273@redhat.com> X-Miltered: at nez-perce with ID 40F68D98.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 2004:99 openfile:01 implemented:01 openfile:01 troll:01 linked:01 assertions:01 wrote:03 let:04 boolean:04 exceptions:04 efficient:05 jul:06 i'd:06 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Thu, 15 Jul 2004 14:33:59 +0100, Richard Jones 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