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 TAA22213; Sat, 20 Jul 2002 19:49:11 +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 TAA22316 for ; Sat, 20 Jul 2002 19:49:11 +0200 (MET DST) Received: from sunny.pacific.net.au (sunny.pacific.net.au [203.25.148.40]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g6KHn9v17532 for ; Sat, 20 Jul 2002 19:49:09 +0200 (MET DST) Received: from wisma.pacific.net.au (wisma.pacific.net.au [210.23.129.72]) by sunny.pacific.net.au with ESMTP id g6KHn3Ss006934; Sun, 21 Jul 2002 03:49:03 +1000 (EST) Received: from ozemail.com.au (ppp175.dyn26.pacific.net.au [61.8.26.175]) by wisma.pacific.net.au with ESMTP id DAA18383; Sun, 21 Jul 2002 03:49:01 +1000 (EST) Message-ID: <3D39A28D.4040801@ozemail.com.au> Date: Sun, 21 Jul 2002 03:49:01 +1000 From: John Max Skaller User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.2.1) Gecko/20010901 X-Accept-Language: en-us MIME-Version: 1.0 To: Alessandro Baretta CC: Ocaml 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> <3D386344.5080303@baretta.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Alessandro Baretta wrote: > >> struct X { virtual bool binop(X const&)const=0; }; > > > Tell me if I got this straight: OO polymorphism requires that > inheriting classes wishing to override methods of parents must use > covariant return types and contravariant parameter types, so as to > guarantee that inheritance implies subtyping. In this case, it would > be meaning less to implement interface X because, applying the > contravariance principle to the formal parameter of binop, you'd end > up with a class whose binop will accept as rhs parameters any instance > of any subtype of X. Therefore a class Integer will have a > greater_than_binop accepting instances of class Rational, Real, > Complex, Quaternion ... This is meaningless, of course, so we conclude > that establishing an identity between inheritance and subtyping > relations is paradoxical. Correct? The problem is that for arbitrary implementations of the abstractionX, you clearly cannot encode the primitive binop without knowing the representation of 'this' and the argument. This is a precise assertion compared to saying it is 'meaningless': often there is a good meaning (sure you can add Rationals and quaternions .. :-) Note that the assertion is not a theorem: it is an *assumption*. So it cannot be questioned. > > >> In commerical applications, almost ALL data is relational, >> and so cannot be abstracted. The OO paradigm is not just >> useless here, but downright destructive. > > > Slow... What? I don't follow you here. A relational database is just an encoding of functions like 'a ~b' by making a table of a and b columns. But ~ is a binary operator. -- John Max Skaller, mailto:skaller@ozemail.com.au snail:10/1 Toxteth Rd, Glebe, NSW 2037, Australia. voice:61-2-9660-0850 ------------------- 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