Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] C++ STL and template features compared with OCaml parametric polymorphism and OO features
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: skaller <skaller@u...>
Subject: Re: [Caml-list] C++ STL and template features compared with OCaml parametric polymorphism and OO features
On Tue, 2004-09-28 at 00:04, Brian Hurt wrote:
> On Mon, 27 Sep 2004, Jon Harrop wrote:

> Second, you can do fold, map, iter, etc. in C++- it's just a pain.  To 
> emulate HOFs you define a new class with single virtual member function.  
> The virtual member function then becomes your HOF. 

For templates all you need is a class with an operator()() method.

Dynamic dispatch is only needed if you need
run time function variables (first class functions).

Heh .. it isn't a pain doing this in C++, its
quite easy -- just use Felix. 

-- 
John Skaller, mailto:skaller@users.sf.net
voice: 061-2-9660-0850, 
snail: PO BOX 401 Glebe NSW 2037 Australia
Checkout the Felix programming language http://felix.sf.net



-------------------
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