From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id DDE3EBB91 for ; Tue, 11 Jan 2005 08:04:00 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j0B740MH024994 for ; Tue, 11 Jan 2005 08:04:00 +0100 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 IAA25833 for ; Tue, 11 Jan 2005 08:04:00 +0100 (MET) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.199]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j0B73xCK024991 for ; Tue, 11 Jan 2005 08:03:59 +0100 Received: by wproxy.gmail.com with SMTP id 68so57340wri for ; Mon, 10 Jan 2005 23:03:59 -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=d6ZNuoCe37v5T4QJEVW/KOu27KHsnfuRFVoHKel6SK7Jda8tYZ2FafaJAQ7zGkVDOkmgwQlbGuQ6JvhHVWnVo1BcTfNuwXxiiFs4ZA5PPUET0hh/HAUluQpI3s1lLjee6O7X3n3MNt6NxU5ZBJxS+Ez6tfJks4a7TUkVqvS8I50= Received: by 10.54.52.66 with SMTP id z66mr227791wrz; Mon, 10 Jan 2005 23:03:58 -0800 (PST) Received: by 10.54.5.8 with HTTP; Mon, 10 Jan 2005 23:03:58 -0800 (PST) Message-ID: <875c7e0705011023033fa114ef@mail.gmail.com> Date: Tue, 11 Jan 2005 02:03:58 -0500 From: Chris King Reply-To: Chris King To: skaller@users.sourceforge.net Subject: Re: [Caml-list] Thread safe Str Cc: "O'Caml Mailing List" In-Reply-To: <1105415669.3534.55.camel@pelican.wigram> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <1105415669.3534.55.camel@pelican.wigram> X-Miltered: at nez-perce with ID 41E37A60.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 41E37A5F.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 sourceforge:01 wrote:01 parser:01 ocamllex:01 event-based:01 parsers:01 lexer:01 foo:01 foo:01 lexers:01 parsing:01 regexps:01 parsing:01 ...:98 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 11 Jan 2005 14:54:30 +1100, skaller wrote: > If you want captures use the proper tool, namely a parser, > [...] > If some technology is to be integrated, please use the right technology > and integrate Ocamllex. Event-based parsers are not the "proper tool" for many applications. Why write a lexer and all its necessary event handlers when one can just write "s/foo(.*)bar/bar\1foo/g"? Regular expressions were designed for pattern matching and substitution, and the latter function is why they have captures. Lexers were designed for parsing, not substitution, and thus excel at the former while making the latter difficult. Regexps are certainly the wrong tool for parsing, but they do have their place.