Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] Restricting Method Overriding/Redefinition in Subclass
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-08-18 (19:47)
From: John Prevost <j.prevost@g...>
Subject: Re: [Caml-list] Restricting Method Overriding/Redefinition in Subclass
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.


To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: