Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
The "Objective" part of Objective Caml
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2005-11-08 (02:11)
From: Brian Hurt <bhurt@s...>
Subject: Re: Ant: [Caml-list] The "Objective" part of Objective Caml

On Tue, 8 Nov 2005, skaller wrote:

>>> The object oriented part of OCaml is roughly speaking
>>> just as capable as that of Python, C++, Java, C# etc.
>> Sure, I don't doubt that.
> I do. The Python system is much more 'capable' and much less 'robust'.
> This is typical for dynamic typing vs static typing.

I think I'm with Skaller here- Objects in Ocaml are much less powerfull 
than they are in (for example) Java or Python.  For example, objects in 
Ocaml can not have non-virtual (non-overloadable) methods, or static 
(global) methods.  So patterns like singletons are hard to implement with 
Ocaml objects.

But that's OK- because Ocaml provides other ways to provide those 
capabilities.  The problem I have with a lot of pure-OO languages is the 
need to make objects do everything.  The proper way to do a singleton in 
Ocaml is to use modules, not objects.  If you're not using the true power 
of objects- inheritance, virtual functions, and overloading- you shouldn't 
be using objects.  So the fact that Ocaml doesn't provide support for 
these non-objects isn't a problem.