Version française
Home     About     Download     Resources     Contact us    
Browse thread
Generation of Java code from OCaml
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: blue storm <bluestorm.dylc@g...>
Subject: Re: [Caml-list] Generation of Java code from OCaml
On Thu, Sep 24, 2009 at 1:18 PM, Martin Jambon
<martin.jambon@ens-lyon.org> 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.