From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id KAA05558; Wed, 3 Jul 2002 10:43:01 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id KAA05096 for ; Wed, 3 Jul 2002 10:43:00 +0200 (MET DST) Received: from mel-rto3.wanadoo.fr (smtp-out-3.wanadoo.fr [193.252.19.233]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g638gx914771 for ; Wed, 3 Jul 2002 10:42:59 +0200 (MET DST) Received: from mel-rta7.wanadoo.fr (193.252.19.61) by mel-rto3.wanadoo.fr (6.5.007) id 3D1848E6004CD059; Wed, 3 Jul 2002 10:42:58 +0200 Received: from AlphaSystem.dnsalias.net (80.11.74.121) by mel-rta7.wanadoo.fr (6.5.007) id 3D213175000B957C; Wed, 3 Jul 2002 10:42:58 +0200 Received: from localhost ([127.0.0.1] helo=alphasystem.dnsalias.net) by AlphaSystem.dnsalias.net with esmtp (Exim 3.36 #1 (Debian)) id 17Pfiy-000Hn4-00; Wed, 03 Jul 2002 10:42:56 +0200 From: "Johan Baltié" To: Oleg , caml-list@inria.fr Subject: Re: [Caml-list] generic programming Date: Wed, 3 Jul 2002 09:42:55 +0100 Message-Id: <20020703084255.M78298@wanadoo.fr> In-Reply-To: <200207030246.WAA28665@dewberry.cc.columbia.edu> References: <200207030246.WAA28665@dewberry.cc.columbia.edu> X-Mailer: Open WebMail 1.61 20020204 X-OriginatingIP: 192.6.2.192 (baltie_j) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > Hi > > Is generic programming possible with O'Caml? Suppose I want to find > the Pearson correlation between two sets of real numbers represented > as sets, arrays, big_arrays, maps, stacks, queues or lists. Is it > possible to have one piece of code that handles all of these > containers, a generic function of some sort? (Iteration is all that is > necessary in the Pearson correlation example) Aren't you looking for functors ?? (http://caml.inria.fr/ocaml/htmlman/manual004.html part 2.3) Or did I miss something ? Ciao Jo ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners