Re: CLOS and ML?

From: Didier.Remy@inria.fr
Date: Wed Aug 04 1999 - 12:13:45 MET DST


Date: Wed, 4 Aug 1999 12:13:45 +0200
From: Didier.Remy@inria.fr
To: David McClain <dmcclain@azstarnet.com>
Subject: Re: CLOS and ML?
In-Reply-To: <000b01bed94a$c681b870$210148bf@dylan>; from David McClain on Wed, Jul 28, 1999 at 03:44:36PM -0700

> I have been missing CLOS sooo much that I decided to give it a try in OCAML.
> It turns out that to first order, one can quite readily acheive multi-method
> dispatch using ML-like languages (see below...) Of course it would be far
> more convenient if this were an inherent part of the language. I have
> thought briefly about making a front-end that would accept an extended
> syntax incorporating some notion of multi-methods and having it translate to
> standard OCAML as a result. This would alleviate all runtime dispatching
> except for those cases where a possibly ambiguous data type is acted upon.

What you showed is one way to compile multi-methods in Ocaml, but you turned
off the type system by using dynamic types (implemented as variant types).
An ML user would expect some typechecking, so that in particular 'message not
understood' cannot arise.

> Is there any reason not to make CLOS-like behavior (e.g., STklos, CLOS,
> Dylan) in an ML language?

Typing CLOS-like objects and classes, including polymorphism, remains an
interesting topic for research.

    -Didier



This archive was generated by hypermail 2b29 : Sun Jan 02 2000 - 11:58:24 MET