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 (23:40)
From: brogoff <brogoff@s...>
Subject: Re: Ant: [Caml-list] The "Objective" part of Objective Caml
On Tue, 8 Nov 2005, Brian Hurt wrote:
> > As far as static vs dynamic, dynamic type systems are inherently more
> > capable. There is no "slack" in a dynamically typed language. But the
> > possibility of a runtime exception is of course there.
> But if we restrict ourselves to the domain of correct programs, now I'm
> not so sure.  Well, maybe, in the extreme fringes, there are correct
> programs which are being disallowed by the Ocaml type systems.

The canonical examples are those that involve polymorphic recursion (lots of
examples in Okasaki's Purely Functional data Structures book) and those
that involve flipping on the -rectypes compiler switch. Yes, there are
workarounds, but for the polymorphic recursion case, Haskell is nicer.

Yes, I realize I am nitpicking.

 I've only
> been programming in Ocaml a couple of years now- I may just have not run
> across them yet.  But everything I've wanted to do in Ocaml I've been able
> to do, working with the type system and not against it.
> > The flip side of this is that OCaml is like Perl, with lots of ways to do
> > things, and many overlapping features. The fact that OCaml has classes and
> > modules is good, and that's how I think OO languages should be, but I would
> > expect that protection and hiding be done only by modules and not objects.
> To my knowledge, they are.  How do you declare a private or protected
> method for a class variable *without* using modules to do so?

There are private methods in OCaml classes. I can imagine in other OO languages
that there would be none, and the privateness would be controlled by the module
system. It's only in 3.09 that we have private rows, which are a step in the
right direction.

-- Brian