From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 01AAEBBFB for ; Sun, 19 Jun 2005 20:05:41 +0200 (CEST) Received: from smtp.irisa.fr (smtp.irisa.fr [131.254.254.26]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j5JI5ec9008731 for ; Sun, 19 Jun 2005 20:05:40 +0200 Received: from localhost (localhost.localdomain [127.0.0.1]) by localhost.irisa.fr (Postfix) with ESMTP id 92D19FAC3; Sun, 19 Jun 2005 20:05:40 +0200 (CEST) Received: from smtp.irisa.fr ([131.254.254.26]) by localhost (meli.irisa.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 04914-01; Sun, 19 Jun 2005 20:05:38 +0200 (CEST) Received: from mail.irisa.fr (melo.irisa.fr [131.254.254.28]) by smtp.irisa.fr (Postfix) with ESMTP id 9FEDEFAB9; Sun, 19 Jun 2005 20:05:38 +0200 (CEST) Received: from 62.147.45.218 (SquirrelMail authenticated user padiolea) by mail.irisa.fr with HTTP; Sun, 19 Jun 2005 20:05:38 +0200 (CEST) Message-ID: <49293.62.147.45.218.1119204338.squirrel@mail.irisa.fr> In-Reply-To: References: Date: Sun, 19 Jun 2005 20:05:38 +0200 (CEST) Subject: Re: [Caml-list] C++ templates to OCaml From: padiolea@irisa.fr To: "Jonathan Roewen" Cc: caml-list@yquem.inria.fr User-Agent: SquirrelMail/1.4.4 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-Virus-Scanned: by amavisd-new at irisa.fr X-Miltered: at concorde with ID 42B5B3F4.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 ocaml:01 irisa:01 ocaml:01 caml-list:01 beginner's:01 beginners:01 bug:01 polymorphic:01 rewrite:01 functions:01 functions:01 bin:01 caml:02 caml:02 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.2 required=5.0 tests=NO_REAL_NAME autolearn=disabled version=3.0.2 X-Spam-Level: > Hi, > > What's the best way to imitate C++ templates in OCaml? Well, simply use polymorphic types and functions. > 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? read the ocaml manual, or code in list.ml for instance in the ocaml standard library. > Jonathan > > _______________________________________________ > Caml-list mailing list. Subscription management: > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list > Archives: http://caml.inria.fr > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs >