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 LAA23117; Wed, 26 May 2004 11:56:38 +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 LAA23036 for ; Wed, 26 May 2004 11:56:37 +0200 (MET DST) X-SPAM-Warning: Sending machine is listed in blackholes.five-ten-sg.com Received: from mwinf0603.wanadoo.fr (smtp6.wanadoo.fr [193.252.22.25]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i4Q9uaSH004762 for ; Wed, 26 May 2004 11:56:36 +0200 Received: from vanicat.homelinux.org (ca-bordeaux-32-71.w80-8.abo.wanadoo.fr [80.8.202.71]) by mwinf0603.wanadoo.fr (SMTP Server) with ESMTP id E76B6240058B for ; Wed, 26 May 2004 11:56:34 +0200 (CEST) Received: from moi by vanicat.homelinux.org with local (Exim 4.34) id 1BSv96-0001sh-PH for caml-list@inria.fr; Wed, 26 May 2004 11:56:24 +0200 To: caml-list@inria.fr Subject: Re: [Caml-list] unix.chop_extension References: <1085429093.6065.336.camel@pelican.wigram> <20040526110508.A17806@pauillac.inria.fr> From: Remi Vanicat Mail-Copy-To: never Date: Wed, 26 May 2004 11:56:24 +0200 In-Reply-To: <20040526110508.A17806@pauillac.inria.fr> (Xavier Leroy's message of "Wed, 26 May 2004 11:05:08 +0200") Message-ID: <87smdnfr5j.dlv@vanicat.homelinux.org> User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 8bit X-Miltered: at concorde with ID 40B469D4.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 chop:01 chop:01 foo:01 usefulness:01 gif:99 jpg:99 helper:01 writes:01 remi:01 remi:01 vanicat:01 vanicat:01 parser:02 unix:02 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Xavier Leroy writes: [...] >> There's one extra thing I'd like to point out. We have the >> chop_extension function. Why in the world is there no find_extension >> function? >> find_extension "foo.bar" --> "bar" > > Why in the world would that be generally useful? Remember, we don't > shoot for completeness (it's unattainable anyway), just for > usefulness. Well, it usefull when one want to use a different parser (or more generally a different "file reader) for different type file (gif, jpg,...), or launch a different helper program for different type of file. (Well, I agree that the usage of a "magic number" is a better way to do it, but the usage of the extension is easier). -- Rémi Vanicat ------------------- 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