From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id pBV9Mrg2011785 for ; Sat, 31 Dec 2011 10:22:53 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhQCAG/T/k7RVdS2kGdsb2JhbABDnCeIHAGICAgiAQEBAQkJDQcUBCGBcgEBAQMBEgIsARsSCwEDAQsGBQQHGiEiAREBBQEKEgYTCAoQh1gImEEKi2WCa4QvP4hxAgULg3KIEgSCWpIojX09g3s X-IronPort-AV: E=Sophos;i="4.71,436,1320620400"; d="scan'208";a="137352575" Received: from mail-wi0-f182.google.com ([209.85.212.182]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 31 Dec 2011 10:22:48 +0100 Received: by wibhr1 with SMTP id hr1so13858880wib.27 for ; Sat, 31 Dec 2011 01:22:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=ZHmC/TLNdVB724MAUnojUIVLHPzdG1Sur1NXkEBR5pg=; b=mXSQtFQg6uWVoUTeErfKLXXmZsBDkMHQplDHrb28DJ7HGtjp/IovqZxvErftsvdA5J rAeJtZpr2CJ/71q+NbNQIURmAYH3Wxxdb7xcI+gNCSM+lkWsaBCJ8X8QhGpeKxnlcE4v 6hgiWHhJxA6fMLapULZl6ktab/dDXM2alkEEk= Received: by 10.180.83.69 with SMTP id o5mr92764271wiy.1.1325323367227; Sat, 31 Dec 2011 01:22:47 -0800 (PST) MIME-Version: 1.0 Received: by 10.227.198.147 with HTTP; Sat, 31 Dec 2011 01:22:26 -0800 (PST) In-Reply-To: References: From: Gabriel Scherer Date: Sat, 31 Dec 2011 10:22:26 +0100 Message-ID: To: Anil Madhavapeddy Cc: caml users Content-Type: multipart/alternative; boundary=f46d0442889084219d04b55fe424 Subject: Re: [Caml-list] working %.pp.ml target with ocamfind/ocamlbuild --f46d0442889084219d04b55fe424 Content-Type: text/plain; charset=ISO-8859-1 I was also under the impression that ocamlbuild Ocamlfind integration was unable to use archive(syntax) or archive(preprocessor) dependencies for ocamlfind packages providing syntax extensions. This is a serious limitation as it makes some ocamlfind packages unusable. If you're considering improving this, I thank you in advance. > I took a look at adding support for this into ocamlbuild (when -use-ocamlfind is specified), but I couldn't spot any way to get ocamlfind to output the syntax options. I'm not sure what you're looking for exactly. If you whish to know what archives should be included at the preprocessing step, this is done using the "-predicates" option with, say, "-predicates syntax,preprocessor", which will gives you the archives included in this situation: % ocamlfind query -predicates syntax,preprocessor -format '%A' type-conv pa_type_conv.cma > Does everyone else manually run the camlp4o command when using syntax extensions like type-conv or pa_lwt? 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. On Sat, Dec 31, 2011 at 12:19 AM, Anil Madhavapeddy wrote: > There's a very useful %.pp.ml target in OCamlbuild that runs the source > through camlp4 and outputs the result. This doesn't work when ocamlfind is > used, as it includes the -pp flags within the ocamlfind invocation. > > I took a look at adding support for this into ocamlbuild (when > -use-ocamlfind is specified), but I couldn't spot any way to get ocamlfind > to output the syntax options. > > I just wanted to check that this is all in fact true, since it requires > patching ocamlbuild, findlib, and oasis to make it work. Does everyone else > manually run the camlp4o command when using syntax extensions like > type-conv or pa_lwt? > > -anil > > -- > Caml-list mailing list. Subscription management and archives: > https://sympa-roc.inria.fr/wws/info/caml-list > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs > > --f46d0442889084219d04b55fe424 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I was also under the impression that ocamlbuild Ocamlfind integration was u= nable to use archive(syntax) or archive(preprocessor) dependencies for ocam= lfind packages providing syntax extensions. This is a serious limitation as= it makes some ocamlfind packages unusable. If you're considering impro= ving this, I thank you in advance.

> I took a look at adding support for this into ocamlbuild (when=20 -use-ocamlfind is specified), but I couldn't spot any way to get=20 ocamlfind to output the syntax options.

I'm not sure what you're looking for exactly. If you whish to k= now what archives should be included at the preprocessing step, this is don= e using the "-predicates" option with, say, "-predicates syn= tax,preprocessor", which will gives you the archives included in this = situation:

=A0 % ocamlfind query -predicates syntax,preprocessor -format '%A&#= 39; type-conv
=A0 pa_type_conv.cma

> Does everyone else manual= ly run the camlp4o command when using syntax extensions like type-conv or p= a_lwt?

This is useful for debugging purposes, and for some (minor) modes of us= e of Camlp4. However, for most Camlp4 development, this has the severe down= side of losing the location information of the original file, if I understa= nd correctly. This means that you don't want to use it as a transparent= step towards compilation, but only in exceptional situations where the dev= elopers will re-edit the output code.

On Sat, Dec 31, 2011 at 12:19 AM, Anil Madha= vapeddy <Anil@recoi= l.org> wrote:
There's a very useful %.pp.m= l target in OCamlbuild that runs the source through camlp4 and outputs = the result. =A0This doesn't work when ocamlfind is used, as it includes= the -pp flags within the ocamlfind invocation.

I took a look at adding support for this into ocamlbuild (when -use-ocamlfi= nd is specified), but I couldn't spot any way to get ocamlfind to outpu= t the syntax options.

I just wanted to check that this is all in fact true, since it requires pat= ching ocamlbuild, findlib, and oasis to make it work. Does everyone else ma= nually run the camlp4o command when using syntax extensions like type-conv = or pa_lwt?

-anil

--
Caml-list mailing list. =A0Subscription management and archives:
https://sympa-roc.inria.fr/wws/info/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs


--f46d0442889084219d04b55fe424--