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 3BE19800B6 for ; Wed, 4 Jan 2017 17:04:33 +0100 (CET) X-IronPort-AV: E=Sophos;i="5.33,459,1477954800"; d="scan'208";a="206954888" Received: from dt-64014.paris.inria.fr (HELO [128.93.64.14]) ([128.93.64.14]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-SHA; 04 Jan 2017 17:04:32 +0100 To: Alain Frisch , whitequark@whitequark.org, caml users References: <9576980c-9aad-4af2-e512-dc9c42743cf2@inria.fr> <1e890adc-d031-8cba-27fd-eb0f69944c97@lexifi.com> From: =?UTF-8?Q?Fran=c3=a7ois_Pottier?= Message-ID: <4ba3926b-05b6-7487-1179-9fe11e4b2faf@inria.fr> Date: Wed, 4 Jan 2017 17:04:32 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <1e890adc-d031-8cba-27fd-eb0f69944c97@lexifi.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Caml-list] ppx_deriving question: deferring code generation? Hello Alain, On 04/01/2017 16:20, Alain Frisch wrote: > I don't know if this would cover all similar cases, and perhaps it is a > bit verbose, but what about something like: > > include(struct > type foo = Bar | Baz > > let x = ... > end [@deriving visitors]) This sounds potentially reasonable. However, I am not sure if ppx_deriving allows this. If it doesn't, then I would have to package my code generator as a ppx preprocessor, instead of a ppx_deriving plugin. Maybe that would be easy; I am not sure exactly how much grunt work ppx_deriving is doing for me. -- François Pottier francois.pottier@inria.fr http://gallium.inria.fr/~fpottier/