From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 559A3BB91 for ; Tue, 11 Jan 2005 07:41:42 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j0B6ffwP032717 for ; Tue, 11 Jan 2005 07:41:42 +0100 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 HAA24558 for ; Tue, 11 Jan 2005 07:41:41 +0100 (MET) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.206]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j0B6feLQ032714 for ; Tue, 11 Jan 2005 07:41:41 +0100 Received: by wproxy.gmail.com with SMTP id 68so56181wri for ; Mon, 10 Jan 2005 22:41:40 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=g6ZBPeMtQ/VlMQa+CLHUV2yc6IAJ5qFbe3KIwEQNuGkXwMaIL4S4kCKFB/KFG04tt4DHoFQTARAHXD3hcKswnmpSqjit7XYjKZMjn769iGF/sxE6JiUJrhylrS4fhgf7kXwdieMTKkf1stlDKmfvX9XHFUfzPsLfwD+oZMVW5zk= Received: by 10.54.5.12 with SMTP id 12mr300757wre; Mon, 10 Jan 2005 22:41:40 -0800 (PST) Received: by 10.54.5.8 with HTTP; Mon, 10 Jan 2005 22:41:39 -0800 (PST) Message-ID: <875c7e07050110224143f51757@mail.gmail.com> Date: Tue, 11 Jan 2005 01:41:39 -0500 From: Chris King Reply-To: Chris King To: Xavier Leroy Subject: Re: [Caml-list] Thread safe Str Cc: "O'Caml Mailing List" In-Reply-To: <20050110154917.GA4582@yquem.inria.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <20050109.203010.110660321.Christophe.Troestler@umh.ac.be> <20050110154917.GA4582@yquem.inria.fr> X-Miltered: at concorde with ID 41E37526.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 41E37524.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 wrote:01 thread-safe:01 api:01 syntax:01 regexps:01 regexps:01 api:01 python's:01 ocaml:01 iirc:01 sequences:01 avoiding:01 backslash:01 garbage:01 X-Spam-Checker-Version: SpamAssassin 3.0.0 (2004-09-13) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_BY_IP autolearn=disabled version=3.0.0 X-Spam-Level: On Mon, 10 Jan 2005 16:49:17 +0100, Xavier Leroy wrote: > Besides being thread-safe, the new API could also expose > the abstract syntax tree for regexps, allowing easier construction of > complex regexps by programs than can be done by working at the level > of the string representation of regexps. Nifty! This is something I'd really like to see. > But if a few persons on this list want to team up to > design an API, that would be wonderful indeed. I was actually considering writing a wrapper for Str modeled after Python's object-oriented re library, which I've found to be very well-designed (much better than any syntax-based solution). Being relatively new to OCaml, I'm not sure that classes in the standand library are considered kosher; would it be preferable to use types rather than classes? Also, Python (and IIRC Perl also) support "raw" strings, strings which do not interpret escape sequences. These are very useful for avoiding extra backslash garbage in regular expressions; and (I assume) could be easily added to OCaml to ease the usage of regexps.