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 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 3F9D7BC6B for ; Fri, 13 Jul 2007 17:51:26 +0200 (CEST) Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.176]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l6DFpPIB027172 for ; Fri, 13 Jul 2007 17:51:25 +0200 Received: by wa-out-1112.google.com with SMTP id m34so703141wag for ; Fri, 13 Jul 2007 08:51:24 -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:mime-version:content-type:content-transfer-encoding:content-disposition; b=kta0+eRQ1MZgs8uGKR6BOoXRdN6wO2P18dpYFDJwXWcXYwooCJjviDc1lnOeZN3MkiLaoQ+R4YVv8C0iF5mEwZzSMoX/xeCknuaUBJKTZ6sdwhzmbIElLzfJq6h+6Pj2abwrnH7k1RdoWUF3qdlXWCzA4oYOn62m/aRq0baTlAw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=lwMGcea5x0/jEBzggbXIZz1iW39roA6SkBdXnFiQi7dxPymj9rMWWpnIju2OEwFJAKRrsudnX0fyxNlNHLqEZN5IDdRmmN7LSZleBAEmxkP4RE+DHWzn8QPH21y4XpM3rYxY7k2T9mesINwnCDANdOZU8rLxUXxCxxbkjOYdbjU= Received: by 10.114.80.4 with SMTP id d4mr1766456wab.1184341884564; Fri, 13 Jul 2007 08:51:24 -0700 (PDT) Received: by 10.114.123.5 with HTTP; Fri, 13 Jul 2007 08:51:19 -0700 (PDT) Message-ID: <90823c940707130851j5cc801b2o919261db22064da9@mail.gmail.com> Date: Fri, 13 Jul 2007 19:51:19 +0400 From: "Dmitry Bely" To: "Caml List" Subject: Camlp4: type declaration quotation MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline X-j-chkmail-Score: MSGID : 46979F7D.000 on discorde : j-chkmail score : X : 0/20 1 0.000 -> 1 X-Miltered: at discorde with ID 46979F7D.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; camlp:01 camlp:01 ctyp:01 ctyp:01 assert:01 dmitry:01 dmitry:01 constraint:01 constraint:01 bely:01 bely:01 declaration:02 declaration:02 string:02 loc:03 Suppose I have EXTEND Gram str_item: [ [ "type"; tdl = LIST1 type_declaration SEP "and" -> ... How to de-construct tdl elements? Specifically I would like to get the same type here as with the old Camlp4. I am thinking of something like let tdl = List.map (fun [<:ctyp< type ... >> -> ... | _ -> assert False]) tdl in ... But how to use <:ctyp< type ... >> ? The only mention in the docs is <:ctyp< type t 'a 'b 'c = t constraint t = t constraint t = t >> Type declaration TyDcl of Loc.t and string and list ctyp and ctyp and list (ctyp * ctyp) Can you explain what it means and give any example? - Dmitry Bely