From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by sympa.inria.fr (Postfix) with ESMTPS id D07797ED7A for ; Mon, 10 Sep 2012 14:08:13 +0200 (CEST) Received-SPF: None (mail1-smtp-roc.national.inria.fr: no sender authenticity information available from domain of bobzhang1988@gmail.com) identity=pra; client-ip=74.125.83.54; receiver=mail1-smtp-roc.national.inria.fr; envelope-from="bobzhang1988@gmail.com"; x-sender="bobzhang1988@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail1-smtp-roc.national.inria.fr: domain of bobzhang1988@gmail.com designates 74.125.83.54 as permitted sender) identity=mailfrom; client-ip=74.125.83.54; receiver=mail1-smtp-roc.national.inria.fr; envelope-from="bobzhang1988@gmail.com"; x-sender="bobzhang1988@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail1-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-ee0-f54.google.com) identity=helo; client-ip=74.125.83.54; receiver=mail1-smtp-roc.national.inria.fr; envelope-from="bobzhang1988@gmail.com"; x-sender="postmaster@mail-ee0-f54.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AiEBAKTXTVBKfVM2kGdsb2JhbABFuzkIIgEBAQEJCQ0HFAQjgiABAQEEAQEBDwIkCAEbHAEBAwwGBQsNCRYPCQMCAQIBDwIRAQUBHAYNAQUCAQEeh1sBAw8EnDYJA4wjgnOEYwoZJw1ZiHQBBQyKJIcZA5QIgVWBFIoBgyo+hAg X-IronPort-AV: E=Sophos;i="4.80,398,1344204000"; d="scan'208";a="172515404" Received: from mail-ee0-f54.google.com ([74.125.83.54]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 10 Sep 2012 14:08:13 +0200 Received: by eeke52 with SMTP id e52so1340315eek.27 for ; Mon, 10 Sep 2012 05:08:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:newsgroups:to:cc :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=vMOyrjxCx/JwkRVJs0qnpSAI4guk1FRkvNllsdM6rBE=; b=marfl0zNeaOSDyK8YxNgx5PkhbAv4vtLC37+59waY8QLyjotSugy/xBbhNw0F/NqW8 xiYxneD8VPVduAzMn+qGz95voDiYB9HJxlNcIryVzwlt4qOWo2sOdMFYvdTj7s5bMpla y4ogNAe29ptYWU9RpPzAxKGAfl/7jHiIrDCvAtg5Hk8+tDSKy8HcG6gbxuVJQDKqx4VM 0bpg7l8tCeJgQrWYde5gieVLRT4gjLT5+br2FR1JKMNaEjNJ36BGxGN8rQKHQtCTyi+d jHpyEM3SmlVvY3P3URDluw1o8geIN/bnzBGNmCjtz+J3OYFqNhPd1X76YZcowlixWL8j YwpA== Received: by 10.204.157.22 with SMTP id z22mr3669273bkw.4.1347278892422; Mon, 10 Sep 2012 05:08:12 -0700 (PDT) Received: from Hongbos-MacBook-Air.local ([91.143.127.68]) by mx.google.com with ESMTPS id g6sm6906072bkg.2.2012.09.10.05.08.09 (version=SSLv3 cipher=OTHER); Mon, 10 Sep 2012 05:08:10 -0700 (PDT) Message-ID: <504DD828.3000208@gmail.com> Date: Mon, 10 Sep 2012 14:08:08 +0200 From: Hongbo Zhang User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:15.0) Gecko/20120824 Thunderbird/15.0 MIME-Version: 1.0 Newsgroups: gmane.comp.lang.caml.inria To: Wojciech Meyer CC: Gabriel Scherer , Anil Madhavapeddy , caml users References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Caml-list] Re: working %.pp.ml target with ocamfind/ocamlbuild Greetings, On 9/9/12 6:29 PM, Wojciech Meyer wrote: > Gabriel Scherer writes: > >> This is useful for debugging purposes, and for some (minor) modes of >> use of Camlp4. However, for most Camlp4 development, this has the >> severe downside of losing the location information of the original >> file, if I understand correctly. This means that you don't want to use >> it as a transparent step towards compilation, but only in exceptional >> situations where the developers will re-edit the output code. > > I think I've to say I disagree it's not useful, when I'm developing a > syntax extension on top of Camlp4 I really want to see the generated > code. Moreover to understand some of the more complicated syntax > extensions like type_conv, deriving, FoldGenerator I need to look at the > expanded code to understand how to use it - last time I hit the same Yes, it's damn useful not only for bootstrapping, but also for developing to locate type errors. But there's something wrong with Camlp4's printer, it has *4* printers in total, writing a printer for an Ast which has no backend is totally useless. In my branch of camlp4, *I removed all those 4 printers and using tools/pprintast.ml* in ocaml's compiler source tree(with some my own bug fixes), and it works very well. Btw, are you in ICFP? we could have a talk about Camlp4 :-) > problem it was actually 'deriving-ocsigen' when I needed to implement my > own Show module - it's just much faster to see what's being generated > for the usual case, then trying to figure out from the recipe in the > documentation. Otherwise for bootstrapping purposes, you might want to > pre-generate some code too and put into the repository. > > -- > Wojciech Meyer > http://danmey.org >