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 VAA22744; Wed, 18 Aug 2004 21:47:13 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id VAA23672 for ; Wed, 18 Aug 2004 21:47:11 +0200 (MET DST) Received: from mproxy.gmail.com (rproxy.gmail.com [64.233.170.207]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i7IJlAmL025200 for ; Wed, 18 Aug 2004 21:47:10 +0200 Received: by mproxy.gmail.com with SMTP id 74so288349rnk for ; Wed, 18 Aug 2004 12:47:09 -0700 (PDT) Received: by 10.38.102.41 with SMTP id z41mr489466rnb; Wed, 18 Aug 2004 12:47:09 -0700 (PDT) Message-ID: Date: Wed, 18 Aug 2004 15:47:09 -0400 From: John Prevost Reply-To: John Prevost To: "chris.danx" Subject: Re: [Caml-list] Restricting Method Overriding/Redefinition in Subclass Cc: Caml Mailing List In-Reply-To: <412345DC.5050206@ntlworld.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <411D56EC.2070301@ntlworld.com> <1092469137.29139.564.camel@pelican.wigram> <412345DC.5050206@ntlworld.com> X-Miltered: at nez-perce with ID 4123B23E.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; prevost:01 prevost:01 caml-list:01 overriding:01 2004:99 ntlworld:99 subtypes:01 reuse:01 doubly:01 re-use:01 linked:01 linked:01 chris:01 chris:01 ocaml:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Wed, 18 Aug 2004 13:04:44 +0100, chris.danx wrote: > > 2) Subclasses that are not subtypes > > The first one is easy to understand, but the second example took a while > to get my head around. I think I understand the implications of it now, > although it is still a bit unclear to me how the reuse works in this > example. I sort of understand it, but bits of it are unclear. Need to > think about it for a while. Well, to be honest, the example is not a very good example. With the linked lists and doubly linked lists, the amount of code that is re-used is pretty small compared to the amount of work that needs to be done to re-use it. Try looking at the section on binary methods in the OCaml manual (Section 3.16) for a much much simpler example of a subclass that is not a subtype. Both section 3 and section 5 of the manual are very very good things to read to get a handle on this object system. John. ------------------- 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