English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
C++/C# inheritance is bad?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2009-01-22 (04:03)
From: Yaron Minsky <yminsky@g...>
Subject: Re: [Caml-list] Re: Visitor in OCaml
On Wed, Jan 21, 2009 at 3:09 PM, Yoann Padioleau <padator@wanadoo.fr> wrote:

> Moreover, sometimes you need to do things slightly differently
> from what is auto-generated and it becomes painful. For instance
> it's possible to auto-generate the string_of_xxx for each
> type xxx, but at some point you may want to do the printing
> slightly differently, hide a few things, do some indentation
> work (and use the Format library), etc, and at this point
> you will have to write the tedious code. Camlp4
> metaprogramming may save you some time at the beginning, but but do you
> really
> win that much time in the end ?


Sexplib is entirely an exercise in camlp4 metaprogramming, and it has saved
us countless hours of work and simplified our lives greatly.  Yes, if you
need lots of variations on your serialization and deserialization functions
then camlp4 is a painful way of going about it.  But things like sexplib act
as general language extensions which can provide broadly useful
functionality at a low cost.  I really think it's a very big win.