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 PAA18085; Mon, 19 Jan 2004 15:43:36 +0100 (MET) 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 PAA18040 for ; Mon, 19 Jan 2004 15:43:35 +0100 (MET) Received: from beaune.inria.fr (beaune.inria.fr [128.93.8.3]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id i0JEhYv07965; Mon, 19 Jan 2004 15:43:34 +0100 (MET) Received: by beaune.inria.fr (8.8.8/1.1.22.3/14Sep99-0328PM) id PAA0000008441; Mon, 19 Jan 2004 15:43:33 +0100 (MET) Date: Mon, 19 Jan 2004 15:43:33 +0100 From: Luc Maranget To: Richard Jones Cc: Luc Maranget , Brian Hurt , Ocaml Mailing List Subject: Re: [Caml-list] ANNOUNCE: mod_caml 1.0.6 - includes security patch Message-ID: <20040119154333.A7394@beaune.inria.fr> References: <20040116093454.GA23909@redhat.com> <20040119111353.A31726@beaune.inria.fr> <20040119113637.GA30306@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20040119113637.GA30306@redhat.com>; from rich@annexia.org on Mon, Jan 19, 2004 at 11:36:37AM +0000 X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 2004:99 freshmeat:01 dbi:99 threads:01 camlp:01 matchings:01 camlp:01 expressivity:01 expressivity:01 regexps:01 dynamically:01 regexps:01 api:01 ltd:98 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > On Mon, Jan 19, 2004 at 11:13:53AM +0100, Luc Maranget wrote: > > I am not exactly sure I understand your needs. But you should probably have a > > look at ocamllex. > > Coming from a Perl background, ocamllex is a very heavyweight solution > for the simple problem of doing quick string matches. The > Regexp/OCaml package looks very good indeed - shame it can't be part > of the standard syntax! > > Rich. > > -- > Richard Jones. http://www.annexia.org/ http://freshmeat.net/users/rwmj > Merjis Ltd. http://www.merjis.com/ - improving website return on investment > PTHRLIB is a library for writing small, efficient and fast servers in C. > HTTP, CGI, DBI, lightweight threads: http://www.annexia.org/freeware/pthrlib/ Normally, using camlp4 you can insert regexp matchings in ``standard'' syntax. Although the current manual of camlp4 does not tell much about that. Furthermore the code is at the moment broken in the CVS tree... To me, the extra burden of having to preprocess the lexer source is not that heavy in a big program, where you have Makefiles anyway. Besides some expressivity bonuses (but beware, such expressivity often comes with fuzziness) one advantage of the library approach is the possibility to give regexps dynamically (eg by reading external files). Few applications take advantage of this. Of course all my nice reasoning fails when you consider ``scripting'', but even then, the idea of putting regexps in strings leads to unncessary complications (ie many backslashes). A more convenient way would be by some regexp data type either abstract or concrete. Such an API should probably be added to supported ocaml regexp packages. Cheers, -- Luc ------------------- 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