Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
camlp4 and class introspection
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-06-10 (22:07)
From: Yaron Minsky <yminsky@c...>
Subject: Re: [Caml-list] camlp4 and class introspection
Others can probably give a better definition of type-directed programming
than I can, and it's possible I'm misusing the time.  But in any case, what
I mean by type-directed programming is roughly this:  for each type, you
define a value corresponding to that type that contains useful information
about the type.  In our s-expression macros, these values are simply
functions named sexp_of_<type> and <type>_of_sexp for each type.  The role
of these values is to essentially give you a run-time representation of the
type, in a rather static way.

Macros come in by giving you a way to automate the generation of these
type-related values, which otherwise can be rather tedious.


On 6/10/07, Joel Reymont <> wrote:
> Yaron,
> On Jun 10, 2007, at 9:02 PM, Yaron Minsky wrote:
> > I actually think you can do this kind of thing with a combination of
> > type-directed programming and macros.
> What would be type-directed programming in this scenario?
> Would this be done within camlp4?
>         Thanks, Joel
> --
>      - EasyLanguage to C# translator
>  - Blog