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 UAA07151; Fri, 19 Jul 2002 20:33:21 +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 UAA07145 for ; Fri, 19 Jul 2002 20:33:21 +0200 (MET DST) Received: from night.its.uiowa.edu (night.its.uiowa.edu [128.255.56.106]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g6JIXJv26516 for ; Fri, 19 Jul 2002 20:33:20 +0200 (MET DST) Received: from uiowa.edu (host38-92.uihc.uiowa.edu [129.255.38.92]) by night.its.uiowa.edu (8.11.6/8.11.6/ns-mx-1.14) with ESMTP id g6JIXHl05600 for ; Fri, 19 Jul 2002 13:33:18 -0500 Message-ID: <3D385B6D.9090505@uiowa.edu> Date: Fri, 19 Jul 2002 13:33:17 -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 To: caml-list@inria.fr Subject: Re: [Caml-list] productivity improvement References: <20020716172916.4903.qmail@web10702.mail.yahoo.com> <200207190358.XAA11620@dewberry.cc.columbia.edu> <20020719010318.B3631@boson.den.co.bbnow.net> <200207190821.EAA09974@hickory.cc.columbia.edu> <3D37D474.2551F19E@ps.uni-sb.de> <3D37E669.6050608@baretta.com> <3D38573E.2030908@ozemail.com.au> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk John Max Skaller wrote: > Alessandro Baretta wrote: > No. (class based) object orientation is utterly flawed as a paradigm, as > can be seen by posing the trivial problem of representing any type > with a binary operator. > It just can't be done, the problem is called 'covariance problem'. > > I find it hard to state what the problem is here, but I'll try: > the problem is you can write an unimplementable interface > and not get a type error: > > struct X { virtual bool binop(X const&)const=0; }; Do you really mean _all_ class-based object orientation? Don't multimethods and/or overloading help in this case? bool equals(x : 'a, y : 'b) = false ; bool equals(x : Integer, y : Integer) = x.intValue() = y.intValue() ; bool equals(x : String, y : String) = (* compare all the chars *) ; bool equals(x : String, y : Integer) = equals(x, y.toString()) ; This seems to be what Nice does. Nice is based on the ML(less-than-or-equal) type system. Perhaps, your comments only apply to a certain subset of class-based object-orietned languages? - 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