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 08AC1BBFB for ; Sun, 19 Jun 2005 08:53:06 +0200 (CEST) Received: from rproxy.gmail.com (rproxy.gmail.com [64.233.170.207]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j5J6r5bT024710 for ; Sun, 19 Jun 2005 08:53:05 +0200 Received: by rproxy.gmail.com with SMTP id a36so74611rnf for ; Sat, 18 Jun 2005 23:53:05 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=fxRw0EzHJBFuHIw+0B+xW0p5G6d8C4gZFrxN1OMQX/QXtpszLrxsIvZHwqfPgKHCbSnvO1L1usFM+4/Qu7d+9xIVsuEvbfvyLRl592bOseNN+KD8RFCgvJnaLxNPC1JsU1w5DZc4hrDTYM2yXkLfnAvgEUHKqvQcnhgvLSFLhw0= Received: by 10.38.181.14 with SMTP id d14mr1725734rnf; Sat, 18 Jun 2005 23:53:05 -0700 (PDT) Received: by 10.38.209.44 with HTTP; Sat, 18 Jun 2005 23:53:04 -0700 (PDT) Message-ID: Date: Sun, 19 Jun 2005 18:53:05 +1200 From: Jonathan Roewen Reply-To: Jonathan Roewen To: caml-list@yquem.inria.fr Subject: [Caml-list] C++ templates to OCaml Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Miltered: at nez-perce with ID 42B51651.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 ocaml:01 ocaml:01 rewrite:01 functions:01 objects:02 types:02 messy:09 example:10 templates:11 templates:11 some:12 what's:14 using:15 record:15 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=RCVD_BY_IP autolearn=disabled version=3.0.2 X-Spam-Level: Hi, What's the best way to imitate C++ templates in OCaml? I have some code that makes extensive use of templates that I want to rewrite in OCaml, and using record types and functions is getting messy, and a lot more convoluted than the C++ code. Are objects the way to go here? And if so, can someone give me a simple example of how this would work? Jonathan