From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: ** X-Spam-Status: No, score=2.2 required=5.0 tests=AWL,DNS_FROM_RFC_POST, SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id AF55ABBAF for ; Thu, 24 Sep 2009 14:02:17 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AukBANT8ukrRVYT5kGdsb2JhbACRSoh4PwEBAQEJCQwHEwOpPIExj3oBAwIEhBcFgVg X-IronPort-AV: E=Sophos;i="4.44,445,1249250400"; d="scan'208";a="33432436" Received: from an-out-0708.google.com ([209.85.132.249]) by mail2-smtp-roc.national.inria.fr with ESMTP; 24 Sep 2009 14:02:17 +0200 Received: by an-out-0708.google.com with SMTP id d14so649124and.3 for ; Thu, 24 Sep 2009 05:02:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=jvAzJumM/NtehR0S5wkhEVkQzbMaIu9MUTn3b7bc3ts=; b=FpJ66xLflVQ4vnwLtJWS3yhdYfhKXsCg72rdxOrHrmfFYYwWq3zOkWxa4yw0S2yH5Y GutwnCAfqEVuTBU8A2IDqQCxHgKXkhWGBlAoHrGh0k5UFh2AlPciD25NYQM4YxGQ1iCM 1XDUd2BtoUjWaN64H4+mA0b7WlqnNTPDvxFc8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=rFhK/GU2bZ13DVFsnegbABJY7A7sVlvXloGctNose8qEf4sS6M8IsuilNXDsz9gxM8 frZ1/gVNm5otclHUcQm5jdg0X2tK8Cdp9TBjBlv8itU+hUXPhB1Nb3SucpCYBr4Ulevt HrZmSxEAjXc/xb88D+0sI0KTq9jYu9u8CSRp0= MIME-Version: 1.0 Received: by 10.101.47.6 with SMTP id z6mr4149300anj.140.1253793736087; Thu, 24 Sep 2009 05:02:16 -0700 (PDT) In-Reply-To: <4ABB5597.9010805@ens-lyon.org> References: <46ACB6F9-FFAE-4C9C-9E46-21CA2E93434C@mykola.org> <20090923195713.GA12236@annexia.org> <001a01ca3ced$8ef58050$ace080f0$@metastack.com> <527cf6bc0909240245g11ce241cr16ac482003bb25f2@mail.gmail.com> <4ABB5597.9010805@ens-lyon.org> Date: Thu, 24 Sep 2009 14:02:14 +0200 Message-ID: <527cf6bc0909240502p1292ca1fs5890d3efeac49531@mail.gmail.com> Subject: Re: [Caml-list] Generation of Java code from OCaml From: blue storm To: Martin Jambon Cc: Mykola Stryebkov , David Allsopp , caml-list@yquem.inria.fr Content-Type: text/plain; charset=ISO-8859-1 X-Spam: no; 0.00; ocaml:01 ens-lyon:01 patching:01 patching:01 def:01 camlp:01 camlp:01 storm:98 2009:98 wrote:01 caml-list:01 functions:01 jambon:01 jambon:01 behaviour:01 On Thu, Sep 24, 2009 at 1:18 PM, Martin Jambon wrote: > Yes, patching the original code of json-static would work but it's not ideal. >>From the example given, it seems that the original poster already uses json-static. In that case, I think that reusing the code logic is a good idea (coherent behaviour, etc.). I suppose that you dislike the "patching" solution as it is not easily reusable (one cannot use the upstream json-static anymore). What about factorising json-static to allow adding arbitrary code generators (represented as functions from (string * type_def) list to a camlp4 Ast) at camlp4-time ? You would have a design similar to type-conv, wich allows adding new generators without modifying type-conv itself.