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 MAA12615 for caml-redistribution; Thu, 12 Aug 1999 12:17:04 +0200 (MET DST) Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id MAA20142 for ; Wed, 4 Aug 1999 12:04:28 +0200 (MET DST) Received: from morgon.inria.fr (morgon.inria.fr [128.93.8.33]) by concorde.inria.fr (8.8.7/8.8.7) with ESMTP id MAA17723; Wed, 4 Aug 1999 12:04:23 +0200 (MET DST) Received: (from remy@localhost) by morgon.inria.fr (8.8.7/8.8.7) id MAA04828; Wed, 4 Aug 1999 12:13:45 +0200 Message-ID: <19990804121345.15126@morgon.inria.fr> Date: Wed, 4 Aug 1999 12:13:45 +0200 From: Didier.Remy@inria.fr To: David McClain Cc: caml-list@inria.fr Subject: Re: CLOS and ML? Reply-To: Didier.Remy@inria.fr References: <000b01bed94a$c681b870$210148bf@dylan> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.85e In-Reply-To: <000b01bed94a$c681b870$210148bf@dylan>; from David McClain on Wed, Jul 28, 1999 at 03:44:36PM -0700 Organization: INRIA, BP 105, F-78153 Le Chesnay Cedex Phone: (33) 1 3963 5317 -- Sec: (33) 1 3963 5570 -- Fax: (33) 1 3963 5684 Web: http://cristal.inria.fr/~remy Sender: weis > 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