From: Brian Rogoff <bpr@best.com>
To: David McClain <dmcclain@azstarnet.com>
Cc: caml-list@inria.fr
Subject: Re: Real excellent object oriented source code examples of Ocaml
Date: Tue, 21 Nov 2000 08:49:00 -0800 (PST) [thread overview]
Message-ID: <Pine.BSF.4.21.0011210811110.374-100000@shell5.ba.best.com> (raw)
In-Reply-To: <01e501c05332$9e924470$210148bf@dylan>
On Mon, 20 Nov 2000, David McClain wrote:
> ... in response to Xavier...
>
> But as someone who learned to appreciate what CLOS had to offer over the
> conventional Smalltalk style of OO, and as an avid user of OCaml, I have to
> say that I really miss CLOS sometimes...
I'm guessing that what you miss is multiple dispatch, right? That is
the distinguishing feature of CLOS with respect to Smalltalk. I hope you
aren't talking about the CLOS MOP since I think that would play havoc with
static typing.
I certainly agree that multiple dispatch has advantages, and some of my
own OO Ocaml code relies on uses of the Visitor pattern, which is obviated
by the presence of multiple dispatch. If I understood the paper correctly,
the "extensional polymorphism" approach which has been discussed here for
adding overloading and safe value IO has some similarities with CLOS
generic functions but I don't know how it interacts with the object system
or polymorphic variants. Maybe Jun or Pierre will comment on this.
With regards to the original poster's query, you may wish to direct your
colleague to Didier Remy's APPSEM notes, which discuss the object system
of Ocaml in detail. If he or you wish to post questions of the form "how
to do this with Ocaml objects" here I'm sure someone will help. I know I
had a tough time initially working around the lack of downcasting and type
querying from Java and C++, but now that I'm a little more proficient I'm
convinced that the designers were right not to include them. If the
designers wish to improve the current OO system, rather than C++ I'd
look to Eiffel for ideas, in particular Eiffel's renaming capabilities.
Of course, there is also the (temporary I hope!) lack of polymorphic
methods, which correspond to C++ member template functions...
Here's the URL for the APPSEM notes:
http://cristal.inria.fr/~remy/cours/appsem/
It is true that OO features are less needed in a language like Ocaml, but
I for one am sure glad they are there.
-- Brian
next prev parent reply other threads:[~2000-11-21 17:03 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-11-20 20:43 David McClain
2000-11-21 16:49 ` Brian Rogoff [this message]
-- strict thread matches above, loose matches on Subject: below --
2000-11-17 14:38 Don Syme
2000-11-19 15:48 ` Mattias Waldau
2000-11-17 12:14 STARYNKEVITCH Basile
2000-11-20 13:46 ` Xavier Leroy
2000-11-23 19:32 ` Anton Moscal
2000-11-28 14:12 ` Renaud.Rioboo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.BSF.4.21.0011210811110.374-100000@shell5.ba.best.com \
--to=bpr@best.com \
--cc=caml-list@inria.fr \
--cc=dmcclain@azstarnet.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox