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.0 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 ADB93BC69 for ; Mon, 30 Apr 2007 16:31:06 +0200 (CEST) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.169]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l3UEV6LA020806 for ; Mon, 30 Apr 2007 16:31:06 +0200 Received: by ug-out-1314.google.com with SMTP id k3so1044644ugf for ; Mon, 30 Apr 2007 07:31:06 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:in-reply-to:references:mime-version:content-type:message-id:cc:content-transfer-encoding:from:subject:date:to:x-mailer; b=BXdyFgtItBq/phjAP/USJnnvo/NZ2ambPKpXQPRnAsCBBgrlCVRH1/1L1+RnoYKWmwz9Ke1Rg9vr4PZ5Zk+l5mODql+RTzIWFLd1++YSgYEtLgAIemw5Bd45hqyhJkY5roFD/0zQMpq/RAkspzPMoYHWVeVJjdEXUMBKjTAD2Mk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:in-reply-to:references:mime-version:content-type:message-id:cc:content-transfer-encoding:from:subject:date:to:x-mailer; b=F/1zYByeaeP1c0AfBsFTF1P3LS2/sNYdJxJLiVucEdXkqUAaptdYM3RDHGKAA8SkAIyUcAkmY33IiBK8WkwdTZ/nGrBJBF2vY30e9HO+WfyZvXuFxvwjl9V198u2cRh5r+XZ4jbEZKHICkj7xgx3mXTmaxj7YHWGlppANUnOBME= Received: by 10.67.96.14 with SMTP id y14mr5473986ugl.1177943466174; Mon, 30 Apr 2007 07:31:06 -0700 (PDT) Received: from ?192.168.1.34? ( [83.52.237.136]) by mx.google.com with ESMTP id j33sm10050153ugc.2007.04.30.07.31.03; Mon, 30 Apr 2007 07:31:04 -0700 (PDT) In-Reply-To: References: <220DCCF0-FD2D-4116-8E30-992C1AD3FE95@gmail.com> Mime-Version: 1.0 (Apple Message framework v752.3) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <162AE889-4F39-48A0-B228-A478EEBE1A13@gmail.com> Cc: "Caml List" Content-Transfer-Encoding: 7bit From: Joel Reymont Subject: Re: Upgrading sexplib-2.7.0 to camlp4 3.10 Date: Mon, 30 Apr 2007 15:31:00 +0100 To: "Nicolas Pouillard" X-Mailer: Apple Mail (2.752.3) X-j-chkmail-Score: MSGID : 4635FDAA.000 on discorde : j-chkmail score : XXX : 5/20 1 0.000 -> 3 X-Miltered: at discorde with ID 4635FDAA.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; camlp:01 ctyp:01 ctyp:01 2007,:98 wrote:01 rec:01 rewrite:01 compile:01 assert:01 ident:02 match:02 match:02 arg:03 arg:03 lid:03 On Apr 30, 2007, at 3:17 PM, Nicolas Pouillard wrote: > id ::= lid | uid | id1 . id2 | id1 id2 > > A function like tp_path is can be rewrite by a function that works > only on idents. So something like this then? let rec tp_path = function | <:ctyp< $lid:id$ >> | <:ctyp< $uid:id$ >> -> [id] | <:ctyp< $id:id$ >> -> (match id with | <:ident< $tp1$ . $tp2$ >> -> (match tp_path tp2 with [n] -> n | _ -> assert false) :: tp_path tp1 | _ -> invalid_arg "tp_path") | _ -> invalid_arg "tp_path" It does compile. -- http://wagerlabs.com/