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=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 13E4EBC6B for ; Thu, 11 Oct 2007 15:05:59 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAJa8DUfAXQImh2dsb2JhbACOSgEBAQgKKQ X-IronPort-AV: E=Sophos;i="4.21,259,1188770400"; d="scan'208";a="2767416" Received: from discorde.inria.fr ([192.93.2.38]) by mail1-smtp-roc.national.inria.fr with ESMTP; 11 Oct 2007 15:05:58 +0200 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l9BD5wEh012656 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Thu, 11 Oct 2007 15:05:58 +0200 X-IronPort-AV: E=Sophos;i="4.21,259,1188770400"; d="scan'208";a="2767414" Received: from peray.inria.fr (HELO ausone.inria.fr) ([128.93.8.98]) by mail1-relais-roc.national.inria.fr with SMTP; 11 Oct 2007 15:05:58 +0200 Received: by ausone.inria.fr (sSMTP sendmail emulation); Thu, _d Oct 2007 15:05:25 +0200 From: "Nicolas Pouillard" Cc: caml-list Subject: Re: [Caml-list] camlp4: From AST to shortcuts To: joelr1 References: <97183C23-C2CB-4915-B406-798B8ABB0E0D@gmail.com> <1192019175-sup-5153@port-ext2.ensta.fr> <1BF51861-4230-498D-B4DF-20F571A68741@gmail.com> In-Reply-To: <1BF51861-4230-498D-B4DF-20F571A68741@gmail.com> Date: Thu, 11 Oct 2007 15:05:25 +0200 Message-Id: <1192107803-sup-2096@ausone.inria.fr> User-Agent: Sup/0.1 Content-Type: text/plain; charset=UTF-8 X-j-chkmail-Score: MSGID : 470E1FB6.000 on discorde : j-chkmail score : X : 0/20 1 0.000 -> 1 X-Miltered: at discorde with ID 470E1FB6.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; camlp:01 eprintf:01 ctyp:01 ctyp:01 camlp:01 expr:01 expr:01 10,:98 2007,:98 wrote:01 partial:01 caml-list:01 int:01 ast:02 ast:02 Excerpts from joelr1's message of Wed Oct 10 15:00:54 +0200 2007: > > On Oct 10, 2007, at 1:36 PM, Nicolas Pouillard wrote: > > > With the pretty printer. > > ... > > let _loc = ghost;; > > Format.eprintf "<:ctyp< %a >>@." pp#ctyp (Ast.TyId (_loc, Ast.IdLid > > (_loc, "int")));; > > That doesn't quite work since I have to know to use a ctyp. I was > wondering if there was a way to figure out the shortcut without > knowing about ctyp beforehand. > > Then again, I looked at Camlp4/Camlp4Ast.partial.ml and, conveniently > enough, TyId is located under ctyp whereas CrIn (class initializer; > what's the "r" in Cr?) is under class_str_item. > > Can it be THAT simple? Of course! The convention for quotations given by camlp4 is <:type_name<...>>, <:expr<...>> is for Ast.expr, <:class_str_item<...>> is for Ast.class_str_item... -- Nicolas Pouillard aka Ertai