From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 2A5047EE48 for ; Tue, 3 Mar 2015 10:40:24 +0100 (CET) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of info@gerd-stolpmann.de) identity=pra; client-ip=212.227.126.130; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="info@gerd-stolpmann.de"; x-sender="info@gerd-stolpmann.de"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of info@gerd-stolpmann.de) identity=mailfrom; client-ip=212.227.126.130; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="info@gerd-stolpmann.de"; x-sender="info@gerd-stolpmann.de"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mout.kundenserver.de) identity=helo; client-ip=212.227.126.130; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="info@gerd-stolpmann.de"; x-sender="postmaster@mout.kundenserver.de"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0AWAgBMgPVUlIJ+49Ragxc9WsE0BoV0AoEiTQEBAQEBARABAQEBBwsLCRIwhA8BAQEDAVUkBQsLGC5XBhMJiB4MCbwdIW8NmS0BAQEBAQEEAQEBAQEdixKESCYHgi1NgTEFhXCKTQGJBIZrA4xxgiUcgVFuAYJCAQEB X-IPAS-Result: A0AWAgBMgPVUlIJ+49Ragxc9WsE0BoV0AoEiTQEBAQEBARABAQEBBwsLCRIwhA8BAQEDAVUkBQsLGC5XBhMJiB4MCbwdIW8NmS0BAQEBAQEEAQEBAQEdixKESCYHgi1NgTEFhXCKTQGJBIZrA4xxgiUcgVFuAYJCAQEB X-IronPort-AV: E=Sophos;i="5.09,681,1418079600"; d="asc'?scan'208";a="124123448" Received: from mout.kundenserver.de ([212.227.126.130]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 03 Mar 2015 10:40:23 +0100 Received: from office1.lan.sumadev.de ([178.4.18.94]) by mrelayeu.kundenserver.de (mreue004) with ESMTPSA (Nemesis) id 0LqY9V-1XojfL3ye9-00e52Z; Tue, 03 Mar 2015 10:40:23 +0100 Received: from [192.168.65.10] (unknown [192.168.65.10]) by office1.lan.sumadev.de (Postfix) with ESMTPSA id 206CDDC05D; Tue, 3 Mar 2015 10:40:22 +0100 (CET) Message-ID: <1425375614.6247.18.camel@e130.lan.sumadev.de> From: Gerd Stolpmann To: Maxence Guesdon Cc: caml-list@inria.fr Date: Tue, 03 Mar 2015 10:40:14 +0100 In-Reply-To: <20150302192423.11734fc7@alcazar2> References: <20150302184846.2531e792@alcazar2> <20150302192423.11734fc7@alcazar2> Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-w3b1Ef485yzYOO1xNhmu" X-Mailer: Evolution 3.10.4-0ubuntu2 Mime-Version: 1.0 X-Provags-ID: V03:K0:rjLkZxKSvXmnO9kJG/YV7qSKAH5IL7MXIIlriswCHO5XP7YwtWY K7tdShlHgC6C2MjVCD/J/Bmw3a2/BJJUU7T2Q8ZR2++IBNwmd+zphUgV8cUC5s14o/kBBO1 WUDJEOhIouxrYXKf6NcUluQXmaOzxsPxQxre0d0erVRY9QSnJT7CIkYWZaBJvuTdcQX58WS DK0lD29QNfYkyMdehBlHQ== X-UI-Out-Filterresults: notjunk:1; Subject: Re: [Caml-list] syntax extensions with ocamlfind --=-w3b1Ef485yzYOO1xNhmu Content-Type: text/plain; charset="ISO-8859-15" Content-Transfer-Encoding: quoted-printable Am Montag, den 02.03.2015, 19:24 +0100 schrieb Maxence Guesdon: > On Mon, 2 Mar 2015 18:07:40 +0000 > Andreas Hauptmann wrote: >=20 > > On Mon, 2 Mar 2015 18:48:46 +0100 > > Maxence Guesdon wrote: > >=20 > > > It seems that ocamlfind only supports camlp4 for preprocessors. Am I > > > right ? Does anybody known how to achieve this ? > >=20 > > Take a look at the META file of camlp5. If i remember right, it achieves > > similar without native support inside ocamlfind. >=20 > Indded, thanks. But it seems that ocamlfind can handle only one > preprocessor, instead of building a command chaining the preprocessors. Chaining isn't that easy. Remember that preprocessors cannot only output source code, but also parsed ASTs. But ASTs are normally not understood as input by the next preprocessor in the chain. Also, preprocessors usually exist to process non-standard syntax. In a chain pp1|pp2, however, pp1 will most likely not understand the extensions understood by pp2, and instead run into a parser error. That makes chaining a questionable concept. Note that chaining works with the new-style ppx preprocessors. This is possible because these preprocessors are restricted to the official syntax (which was extended to make this useful). The ppx chaining is directly implemented in the compiler. > When I have more than one packages defining a preprocessor, I get: >=20 > ocamlfind: Several packages are selected that specify preprocessors: > package camlp4 defines `camlp4', package mypkg.syntax defines > `./mypp' >=20 [...] > So the preprocessor machinery seems very camlp{4,5} oriented. Yes, it is, at least regarding the style the preprocessor is invoked. What is imaginable is that there is some additional preprocessor driver. Let's call it ocamlpp. It would do the chaining for those preprocessors that are compatible. If you call it like ocamlpp (command | object.cmo) ... it runs the preprocessors on the command line in turn, either by executing a command or loading the object. Such a driver would fit into the findlib framework. But as said, I doubt that such a driver would be very useful, as chaining several preprocessors is normally not possible. > I think I'll just require the user to add -pp "ocamlfind mypkg/mypp" on > command line option. I guess so.=20 Gerd --=20 ------------------------------------------------------------ Gerd Stolpmann, Darmstadt, Germany gerd@gerd-stolpmann.de My OCaml site: http://www.camlcity.org Contact details: http://www.camlcity.org/contact.html Company homepage: http://www.gerd-stolpmann.de ------------------------------------------------------------ --=-w3b1Ef485yzYOO1xNhmu Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAABAgAGBQJU9YF+AAoJEAaM4b9ZLB5TwsMH/1LhLb9IbKmc2QfdaCSVF9Zx h4cNwQBE22JjWzJinoD+eEyXYcdADEH/MC+mfMgpI9n3GImyd19LCXHUwZxBwy2r GVCVpW3eIrtDPTDNauZLfiZMAiOIr50ZVFGBp6/RcsrAfKBsYvVA52zejOdtki7m ChHwR4A+430dZeZEK/SbJxKHVT8Jg2ea6I5EuYq4NTWGdZhIFl7jqs8un8TOWUcr aX/V11aCRUD9OC9/Z1DFfDsm6ThV3F6Ard1YUesiFM9GoXUvYnX/bIPSS4wTEyet dxxcdPJxXzadwbnSY6CGAoOUqKriWkx80FFMxOXI3jS/m00HhXQgmV2KTgDBX18= =B8H1 -----END PGP SIGNATURE----- --=-w3b1Ef485yzYOO1xNhmu--