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
[Caml-list] C++ templates to OCaml
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2005-06-19 (13:17)
From: Jacques Carette <carette@m...>
Subject: Re: [Caml-list] C++ templates to OCaml
Jonathan Roewen <jonathan.roewen@gmail.com> wrote:
> What's the best way to imitate C++ templates in OCaml? 

I have been quite successful at doing C++ template-like things in MetaOCaml.

In fact, using Functors and Modules judisciously, it is possible to hide all of the code-generation aspects and write 
quite straightforward code that can be instantiated in many different ways.

An earlier version of this work (joint with Oleg Kiselyov) is available at 
http://www.cas.mcmaster.ca/~carette/metamonads/, and has been accepted at GPCE 2005.

Thanks for asking ;-)