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 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 5209ABC6B for ; Wed, 10 Oct 2007 15:00:56 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAHdpDEfAXQImh2dsb2JhbACOSAIBCAop X-IronPort-AV: E=Sophos;i="4.21,254,1188770400"; d="scan'208";a="4313352" Received: from discorde.inria.fr ([192.93.2.38]) by mail3-smtp-sop.national.inria.fr with ESMTP; 10 Oct 2007 15:00:55 +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 l9AD0tPD006445 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Wed, 10 Oct 2007 15:00:55 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAHdpDEdC+Vyvlmdsb2JhbACOSAIBAQcEBhERBw X-IronPort-AV: E=Sophos;i="4.21,254,1188770400"; d="scan'208";a="2715838" Received: from ug-out-1314.google.com ([66.249.92.175]) by mail1-smtp-roc.national.inria.fr with ESMTP; 10 Oct 2007 15:00:55 +0200 Received: by ug-out-1314.google.com with SMTP id m3so250940ugc for ; Wed, 10 Oct 2007 06:00:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; 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; bh=psDH6DR4nwHyDdqOPLvUAlodW9D1qpeiEP40Z1WDSlo=; b=pyr2offQX0vMaCtUULrMeWRfmpYUEic/Minirq9GNlkvZQRFoIprrYLjFMNOUmh5lq3qgVcyVWBOxVlmTk3OH5tg7fqVg7w6YEWSXTZbBggZ+URL3uCwSc9oBMdjCNn0GfDO/5AU3MF4njyaF70pUgUbByOJ9a0WDA/s3XpGmdg= 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=FHz1g9GrxA6QCc4zVY12xjwICMeNpTwXYJ09DxxtXBPY7JjJZeEVCPvgev3ghcBg8WPXHQCUKqcJ5BsfUOdBrD2WMlU6xizVOF6yk/SQO+kDxxGInv/nR99jmd2g8bkBBs70RrP3PFMdWiKE6kZgwOSZnIJTjKnjc2RJ7YIYwjw= Received: by 10.66.220.17 with SMTP id s17mr1951700ugg.1192021254450; Wed, 10 Oct 2007 06:00:54 -0700 (PDT) Received: from ?192.168.1.33? ( [83.52.235.32]) by mx.google.com with ESMTPS id y34sm10707788iky.2007.10.10.06.00.52 (version=SSLv3 cipher=OTHER); Wed, 10 Oct 2007 06:00:53 -0700 (PDT) In-Reply-To: <1192019175-sup-5153@port-ext2.ensta.fr> References: <97183C23-C2CB-4915-B406-798B8ABB0E0D@gmail.com> <1192019175-sup-5153@port-ext2.ensta.fr> Mime-Version: 1.0 (Apple Message framework v752.3) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <1BF51861-4230-498D-B4DF-20F571A68741@gmail.com> Cc: caml-list Content-Transfer-Encoding: 7bit From: Joel Reymont Subject: Re: [Caml-list] camlp4: From AST to shortcuts Date: Wed, 10 Oct 2007 14:00:54 +0100 To: "Nicolas Pouillard" X-Mailer: Apple Mail (2.752.3) X-Miltered: at discorde with ID 470CCD07.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 10,:98 2007,:98 wrote:01 partial:01 caml-list:01 int:01 ast:02 ast:02 loc:03 loc:03 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? Thanks, Joel -- http://wagerlabs.com