On Mon, 2 May 2005, [ISO-8859-1] Thomas Sandla▀ wrote:

David Storrs wrote:
 Tell me what this does:


class Tree { method bark() { die "Cannot instantiate a Tree--it is abstract!" }
}
class Birch { method bark() { return "White, papery" }
}
class Oak { method bark() { return "Dark, heavy" }
}
class Dog {
method bark() { print "Woof, woof!"; return "bow wow" }
}

Four 'pure' classes so far.


class AlienBeastie isa Tree isa Dog {}

Here you get an error/warning of a composition time conflict between &Tree::bark and &Dog::bark.

I don't think so; I had come to the same conclusion before realising that we are talking inheritance here, not roles. So no trouble at class composition time. Superclasses do not enter the picture while composing.


You'd be right if s/isa/is/ and then s/is/does/, of course.

When you dispatch, what happens would depend upon WALKMETH (according to the pseudocode for CALLONE in A12). Usually the first inherited method would get called.

TSa (Thomas Sandla▀)

regards, abhijit

Reply via email to