From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.1 required=5.0 tests=AWL,SPF_NEUTRAL autolearn=disabled version=3.1.3 Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id EF2C7BC69 for ; Mon, 30 Apr 2007 16:17:37 +0200 (CEST) Received: from nz-out-0506.google.com (nz-out-0506.google.com [64.233.162.225]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l3UEHZ7s018650 for ; Mon, 30 Apr 2007 16:17:37 +0200 Received: by nz-out-0506.google.com with SMTP id l8so2071116nzf for ; Mon, 30 Apr 2007 07:17:34 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=QObOal2vvwEOKqUKxlcocdlYEwgDBG11ORsagFj1j4HYi/fpWnukhBJBCB/AKRVS6ljzM3hiDKrgLqMaIiIRJZ1hJtNfTC4OpfMnZgjaGhZfJVZSy350tF8vIWRZsgAaDmvBc00rvFsHeQEDqvAI4UpBoYFooYNGyZuH47X6Rr8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=pjUeT2Il6WJ76UHkFIijWQLzpu3HigoncNbfO11RVzbqnTkCHv/wiUu1hDErscxQQH3kvLSosNo+zZpKbWc39b2PGgnylhc7qPLBMAtInBOuB1UZrcuApX9jI6ToyvRq4bTjNwaWwObQazPlO2N165KSahSPqVH62mrc3UrCICY= Received: by 10.114.169.2 with SMTP id r2mr2041820wae.1177942653377; Mon, 30 Apr 2007 07:17:33 -0700 (PDT) Received: by 10.114.181.18 with HTTP; Mon, 30 Apr 2007 07:17:33 -0700 (PDT) Message-ID: Date: Mon, 30 Apr 2007 16:17:33 +0200 From: "Nicolas Pouillard" To: "Joel Reymont" Subject: Re: Upgrading sexplib-2.7.0 to camlp4 3.10 Cc: "Caml List" In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <220DCCF0-FD2D-4116-8E30-992C1AD3FE95@gmail.com> X-j-chkmail-Score: MSGID : 4635FA7F.001 on discorde : j-chkmail score : X : 0/20 1 0.000 -> 1 X-Miltered: at discorde with ID 4635FA7F.001 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; camlp:01 ctyp:01 camlp:01 ctyp:01 2007,:98 wrote:01 wrote:01 rec:01 rewrite:01 matched:01 assert:01 ident:02 ident:02 match:02 string:02 On 4/30/07, Joel Reymont wrote: > > On Apr 30, 2007, at 3:01 PM, Nicolas Pouillard wrote: > > > So you have to take the case <:ctyp< $id:i$ >> and then play with `i' > > that is an ident and can be matched with <:ident< ... >> > > It looks like this is being taken care of by the first pattern. > > It also looks like the second pattern is matching a list type (in the > old camlp4). > > Does this sound correct? > > let rec tp_path = function > | <:ctyp< $lid:id$ >> | <:ctyp< $uid:id$ >> -> [id] > | <:ctyp< $tp1$ . $tp2$ >> -> > (match tp_path tp2 with [n] -> n | _ -> assert false) :: > tp_path tp1 > | _ -> invalid_arg "tp_path" > lid is for lower case identifier it's a string uid is for upper case identifier it's a string id is for any identifier it's type is ident id ::= lid | uid | id1 . id2 | id1 id2 A function like tp_path is can be rewrite by a function that works only on idents. -- Nicolas Pouillard