From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id EAA02165; Mon, 15 Jul 2002 04:17:45 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 EAA02158 for ; Mon, 15 Jul 2002 04:17:43 +0200 (MET DST) Received: from day.its.uiowa.edu (day.its.uiowa.edu [128.255.56.107]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g6F28Gf00372 for ; Mon, 15 Jul 2002 04:08:32 +0200 (MET DST) Received: from uiowa.edu (host38-92.uihc.uiowa.edu [129.255.38.92]) by day.its.uiowa.edu (8.11.6/8.11.6/ns-mx-1.14) with ESMTP id g6F28C521380 for ; Sun, 14 Jul 2002 21:08:13 -0500 Message-ID: <3D322E8C.8010402@uiowa.edu> Date: Sun, 14 Jul 2002 21:08:12 -0500 From: Brian Smith User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.1a) Gecko/20020611 X-Accept-Language: en-us, en MIME-Version: 1.0 CC: caml-list@inria.fr Subject: Re: [Caml-list] polymorphic methods References: <3D320665.AC5539CD@noos.fr> <20020715100504O.garrigue@kurims.kyoto-u.ac.jp> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Jacques Garrigue wrote: > > Sorry, but there is no handling of instanciation via subtyping. > Currently subtyping and instanciation are orthogonal concepts: you > cannot subtype in an .mli, and you cannot instanciate an > explicitly polymorphic type when subtyping. > I believe it's correct, but you won't make me write the code without a > proof :-) That is really an interesting comment. I wonder, what are people currently researching w.r.t. the object-oriented features of O'Caml? Besides the above, Jacques said that recursive types with classes is not completely defined because (paraphrasing) recursive types are polymorphic and recursive classes are monomorphic: type variant = Node of node and class node = object method as_variant : variant = Node self end I wonder, does a similar problem apply to recursive exceptions and classes?: (* email me for a complete example *) exception NotFound of node and class node = object method find x = ... else raise (NotFound self) end;; And, similarly, it does seem odd that currently it is impossible to create a polymorphic method equivalent to "map" (This type of problem is mentioned in http://citeseer.nj.nec.com/remy98objective.html). Besides polymorphism, I wonder if it is possible to add open classes and multiple dispatch to O'Caml like MultiJava does for Java (http://www.cs.iastate.edu/~cclifton/multijava/). I'm just a beginner and I don't know any of the theory of this yet, so i'm hoping somebody else will give Jacques some proofs of solutions to the above :) Thanks, Brian ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners