From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: weis Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id VAA22523 for caml-redistribution@pauillac.inria.fr; Wed, 3 Nov 1999 21:53:21 +0100 (MET) Resent-Message-Id: <199911032053.VAA22523@pauillac.inria.fr> Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id KAA26914 for ; Mon, 1 Nov 1999 10:02:06 +0100 (MET) Received: from mail.wa.freei.net (Mail.Wa.FreeI.Net [209.162.144.3]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id KAA20877 for ; Mon, 1 Nov 1999 10:02:05 +0100 (MET) Received: from MEngelberg (dial86.b2.tnt4.wa.freei.net [209.162.155.86]) by mail.wa.freei.net (Postfix) with SMTP id AC31831A22 for ; Mon, 1 Nov 1999 02:02:01 -0700 (GMT+7) Message-ID: <00fb01bf2447$9ef382a0$03dedede@walldata.com> From: "Mark Engelberg" To: Subject: Classes AND Modules? What's the point? Date: Mon, 1 Nov 1999 01:01:00 -0800 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Resent-From: weis@pauillac.inria.fr Resent-Date: Wed, 3 Nov 1999 21:53:21 +0100 Resent-To: caml-redistribution@pauillac.inria.fr 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