From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 8CC2BBD74 for ; Thu, 18 Aug 2005 01:08:38 +0200 (CEST) Received: from out3.smtp.messagingengine.com (out3.smtp.messagingengine.com [66.111.4.27]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j7HN8bgU028442 for ; Thu, 18 Aug 2005 01:08:38 +0200 Received: from frontend3.messagingengine.com (frontend3.internal [10.202.2.152]) by frontend1.messagingengine.com (Postfix) with ESMTP id 61356CCA234; Wed, 17 Aug 2005 19:08:36 -0400 (EDT) X-Sasl-enc: hWHnWCBwwXT7i+kc707L6M21XSTLjeD89tvjFeFzRCtO 1124320116 Received: from [172.16.112.115] (burnham.ljcrf.edu [192.231.106.2]) by frontend3.messagingengine.com (Postfix) with ESMTP id 202911DC; Wed, 17 Aug 2005 19:08:35 -0400 (EDT) Date: Wed, 17 Aug 2005 16:08:04 -0700 (PDT) From: Martin Jambon X-X-Sender: martin@droopy To: Alain Frisch Cc: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Snd question In-Reply-To: <43032B50.40902@inria.fr> Message-ID: References: <161F0D30A699A84A8B7435B62BCE33B30360E19F@APS-MSG-01.southpacific.corp.microsoft.com> <43011A10.4090108@havenrock.com> <1124198264.13635.25.camel@localhost.localdomain> <200508161734.38909.jon@ffconsultancy.com> <20050816181604.GA21719@furbychan.cocan.org> <43032B50.40902@inria.fr> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Miltered: at nez-perce with ID 4303C375.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 frisch:01 ocaml:01 ocamlduce:01 ocaml:01 parsing:01 val:01 2005,:98 ...:98 ...:98 wrote:01 wrote:01 jambon:01 jambon:01 patterns:02 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=FORGED_RCVD_HELO autolearn=disabled version=3.0.3 On Wed, 17 Aug 2005, Alain Frisch wrote: > Richard Jones wrote: >> On Tue, Aug 16, 2005 at 05:34:38PM +0100, Jon Harrop wrote: >> >>> Currently, you cannot match [|1; ...|] in OCaml. >> >> >> Yes! Or, "prefix" ^ str. > > This seems like a good place to insert a shameless plug. Thank you. In > OCamlDuce (the extension of OCaml with XML types and patterns), you can > indeed match on string prefixes: [...] This is also something that is relatively easy with Micmatch: $ micmatch Objective Caml version 3.08.3 Camlp4 Parsing version 3.08.3 # let / "prefix" (_* as str) / = "prefixabcd";; val str : string = "abcd" Martin -- Martin Jambon, PhD http://martin.jambon.free.fr