caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Classes AND Modules?  What's the point?
@ 1999-11-01  9:01 Mark Engelberg
  1999-11-03 23:13 ` William Chesters
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Mark Engelberg @ 1999-11-01  9:01 UTC (permalink / raw)
  To: caml-list

I have spent some time this past week looking at OCaml for the first time.
I have no previous experience with ML, but I do have a pretty good
understanding of functional languages in principle.

The thing that confuses me the most about OCaml is that there is a huge
overlap between the functionality of classes and modules, with a couple of
subtle differences.  Classes offer inheritance which is extremely useful,
but modules have a little more typing flexibility, the ability to share
private data among multiple structures in one package, and the ability to
specify compilation units.

The problem is that because modules are slightly more powerful, it appears
that the entire standard library is implemented as modules, not classes,
despite the fact that this is supposed to be Object-oriented Caml!  This
doesn't really make sense to me, because it totally hinders your ability to
subclass and extend the default libraries.

This weird coexistence of classes and modules just doesn't make sense to me.
Wouldn't it have made more sense to simply add the concept of inheritance to
modules, rather than define a new "class" construct that supports
inheritance but not all the other features of modules?  Or if the focus is
intended to gradually shift in the direction of classes rather than modules,
shouldn't the standard libraries reflect this?

Can someone please explain?

Thanks,

Mark Engelberg




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~1999-11-08 16:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-11-01  9:01 Classes AND Modules? What's the point? Mark Engelberg
1999-11-03 23:13 ` William Chesters
1999-11-05 10:13 ` Xavier Leroy
1999-11-05 18:49 ` Francisco Valverde Albacete
1999-11-07 23:31   ` Gerd Stolpmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).