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 SAA01570; Fri, 28 May 2004 18:43:06 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 SAA01637 for ; Fri, 28 May 2004 18:43:04 +0200 (MET DST) Received: from mail3.speakeasy.net (mail3.speakeasy.net [216.254.0.203]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i4SGh2SH008213 for ; Fri, 28 May 2004 18:43:03 +0200 Received: (qmail 14762 invoked from network); 28 May 2004 16:43:01 -0000 Received: from shell2.speakeasy.net ([69.17.110.71]) (envelope-sender ) by mail3.speakeasy.net (qmail-ldap-1.03) with AES256-SHA encrypted SMTP for ; 28 May 2004 16:43:01 -0000 Date: Fri, 28 May 2004 09:43:01 -0700 (PDT) From: brogoff To: Keith Wansbrough cc: caml-list@inria.fr Subject: Re: [Caml-list] unix.chop_extension In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Miltered: at concorde with ID 40B76C16.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; brogoff:01 brogoff:01 caml-list:01 chop:01 haskell:01 speakeasy:01 match:02 unix:02 wrote:03 interface:03 library:03 exceptions:04 exceptions:04 brian:06 fri:07 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Fri, 28 May 2004, Keith Wansbrough wrote: > > interface to use substrings, eliminating Not_found exceptions by considering > > an empty substring to be a failed match. > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > It's not clear that this is always the right thing to do... \([0-9]*\) > can succeed but return an empty substring. Point taken. There's still a lot of "out of band" values that could be used to represent failure, such as substrings with negative indices. And of course, exceptions are perfectly fine for ML, though their functionalness is arguable, and a Clean (or Haskell 2, where they'll hopefully fix this!) substring library wouldn't have them. -- Brian ------------------- 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