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 mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 3EBED7FA5F for ; Tue, 31 Jan 2017 10:30:55 +0100 (CET) Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=whitequark@whitequark.org; spf=Pass smtp.mailfrom=whitequark@whitequark.org; spf=None smtp.helo=postmaster@uruz.whitequark.org Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of whitequark@whitequark.org) identity=pra; client-ip=188.166.218.19; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="whitequark@whitequark.org"; x-sender="whitequark@whitequark.org"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of whitequark@whitequark.org designates 188.166.218.19 as permitted sender) identity=mailfrom; client-ip=188.166.218.19; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="whitequark@whitequark.org"; x-sender="whitequark@whitequark.org"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@uruz.whitequark.org) identity=helo; client-ip=188.166.218.19; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="whitequark@whitequark.org"; x-sender="postmaster@uruz.whitequark.org"; x-conformance=sidf_compatible IronPort-PHdr: =?us-ascii?q?9a23=3A0CGPtxDBVGU+Id/H7FrxUyQJP3N1i/DPJgcQr6Af?= =?us-ascii?q?oPdwSPTyosbcNUDSrc9gkEXOFd2CrakV16yI7uu4AyQp2tWoiDg6aptCVhsI24?= =?us-ascii?q?09vjcLJ4q7M3D9N+PgdCcgHc5PBxdP9nC/NlVJSo6lPwWB6nK94iQPFRrhKAF7?= =?us-ascii?q?Ovr6GpLIj8Swyuu+54Dfbx9GiTe5br5+NhS7oAXeusUKn4dpN7o8xAbOrnZUYe?= =?us-ascii?q?pd2HlmJUiUnxby58ew+IBs/iFNsP8/9MBOTLv3cb0gQbNXEDopPWY15Nb2tRbY?= =?us-ascii?q?VguA+mEcUmQNnRVWBQXO8Qz3UY3wsiv+sep9xTWaMMjrRr06RTiu86FmQwLzhS?= =?us-ascii?q?wZKzA27n3Yis1ojKJavh2hoQB/w5XJa42RLfZyY7/Rcc8fSWdHQ81fVTFOApmk?= =?us-ascii?q?YoUREuQOMvpXoYbzqVUOrxS+CwqiBezhxTJTmn/73q863/g9HQzc3gEtGc8Fvn?= =?us-ascii?q?TOrNXyMacfSe60zKnJzTXfcfxWwCr955LSchAivPqBWrxxccrQyUkzCQzFl0iQ?= =?us-ascii?q?ppb/PzOWzekMvWib7+t8Ve2xkm4ntht+oiKsxss2jYnJnI0Vx0nC+C5kzog1It?= =?us-ascii?q?i4R1R6Yd6iCJZQuCCaN5d2QsM/WG5kojo1yroDuZO9YSMEy4wnygbCZ/GEcIWE?= =?us-ascii?q?+A/vWeeQLDtimn5pZbGyiwyv/UWkzOD3S9O630xQriVfl9nBrnAN2ALX6siAUv?= =?us-ascii?q?Z9412h2SuO1gzJ5OBEIUE0lbbFJJ44374/jIATsUfZEi/xgkX2g7eadkQi+ue2?= =?us-ascii?q?9+Tqeqjqq5yfOoNulw3zM6UjltahDeglMQUCRXWX9OCk2L3m50L5QbFKjvMskq?= =?us-ascii?q?netZDXPcoapq64Aw9JzIkj8gu/AC280NQbhnQGIlJFeBObj4f3IlHOPer3De28?= =?us-ascii?q?g1i2lzdr3f/GMqX7AprRNnjDjKvhfbFl5kFA0gUzyNRf64tQCrEAO/LzRlT8tM?= =?us-ascii?q?fYDx88Kwy72fzrCNR71oMEWGKAGLWVMK3IsVWQ/OIgP/GMZJMJuDb6M/Ul6ebu?= =?us-ascii?q?jXglmV8BfKmmw4EXZWu5H/RnJkWWemDsjc0bHWcLuAo+Vu3qh0eYXT5dfXbhF5?= =?us-ascii?q?47sx8hAYQpCobYcbiqnKCA0T3zSpNMb2ZNDVGXV2/va5mFVu0kaSSII8YnnCZS?= =?us-ascii?q?Bpa7TIp0yhGvqALj1rN9LaKA5S0ZqZ/6ydFv5MXMlRAu+CVpBt6elWaXQDcnzS?= =?us-ascii?q?szWzYq0fUn8gRGwVCZ3P092qQAGA=3D=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0CFBgA2WJBY/xPaprxdHAEBBAEBCgEBF?= =?us-ascii?q?wEBBAEBCgEBgylhhBFOnA+XQCqFeAKCGkMUAQEBAQEBAQEBAQFhKIIzGwGCGwE?= =?us-ascii?q?FIw8BBUEQBAcJDwICGA4CAiwrBhuJagqrKoIlix4BAQEBAQUBAQEBAR4FgQuFP?= =?us-ascii?q?4Rwh1KCXwWbV4JUhBOLDpEBkn82IYFYQ4Y5QIh2AQEB?= X-IPAS-Result: =?us-ascii?q?A0CFBgA2WJBY/xPaprxdHAEBBAEBCgEBFwEBBAEBCgEBgyl?= =?us-ascii?q?hhBFOnA+XQCqFeAKCGkMUAQEBAQEBAQEBAQFhKIIzGwGCGwEFIw8BBUEQBAcJD?= =?us-ascii?q?wICGA4CAiwrBhuJagqrKoIlix4BAQEBAQUBAQEBAR4FgQuFP4Rwh1KCXwWbV4J?= =?us-ascii?q?UhBOLDpEBkn82IYFYQ4Y5QIh2AQEB?= X-IronPort-AV: E=Sophos;i="5.33,314,1477954800"; d="scan'208";a="211484208" Received: from uruz.whitequark.org ([188.166.218.19]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 31 Jan 2017 10:30:52 +0100 Received: by uruz.whitequark.org (Postfix, from userid 1002) id A767920084; Tue, 31 Jan 2017 04:30:48 -0500 (EST) To: =?UTF-8?Q?Fran=C3=A7ois_Pottier?= X-PHP-Originating-Script: 0:rcube.php MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Tue, 31 Jan 2017 09:30:48 +0000 From: whitequark Cc: Drup , caml-list@inria.fr In-Reply-To: <588F6415.4000900@inria.fr> References: <588B89B9.8000502@inria.fr> <588F6415.4000900@inria.fr> Message-ID: <1115108d11d3bb3d740e191d00ed7ebc@whitequark.org> X-Sender: whitequark@whitequark.org User-Agent: Roundcube Webmail/1.2.3 Subject: Re: [Caml-list] [ANN] visitors On 2017-01-30 16:04, François Pottier wrote: >> A big difference is that it load type definition from .cmi files >> directly. > > Indeed, a limitation of the ppx approach is that it is purely syntatic: > a syntax tree (the type definition) is turned into a syntax tree (the > definition of the visitor classes). In particular, at the moment, > "visitors" > cannot generate visitor classes for a pre-existing type. Perhaps one > could > write a tool that reads a .cmi file, but I suppose it would have to be > explicitly invoked as an external tool. I will think about it. I wrote this tool long ago, it's called ppx_import[1]. In fact it motivated some improvements to the compiler, chiefly the way to extract the set of -I paths. It's even linked from ppx_deriving README[2]. [1]: https://github.com/whitequark/ppx_import [2]: https://github.com/whitequark/ppx_deriving/#working-with-existing-types -- whitequark