From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id CA3FFBBFB for ; Sun, 19 Jun 2005 15:17:30 +0200 (CEST) Received: from cgpsrv2.cis.mcmaster.ca (cgpsrv2.CIS.McMaster.CA [130.113.64.62]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j5JDHTwK020299 for ; Sun, 19 Jun 2005 15:17:30 +0200 Received: from [24.43.193.126] (account carette@univmail.cis.mcmaster.ca) by cgpsrv2.cis.mcmaster.ca (CommuniGate Pro WebUser 4.1.8) with HTTP id 95999882; Sun, 19 Jun 2005 09:17:29 -0400 From: "Jacques Carette" Subject: Re: [Caml-list] C++ templates to OCaml To: Jonathan Roewen , caml-list@yquem.inria.fr X-Mailer: CommuniGate Pro WebUser Interface v.4.1.8 Date: Sun, 19 Jun 2005 09:17:29 -0400 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1"; format="flowed" Content-Transfer-Encoding: 8bit X-Miltered: at nez-perce with ID 42B57069.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 ocaml:01 ocaml:01 metaocaml:01 functors:01 oleg:01 wrote:01 modules:01 jacques:01 jacques:01 mcmaster:02 mcmaster:02 quite:06 quite:06 instantiated:09 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.2 X-Spam-Level: Jonathan Roewen 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 ;-) Jacques