blob: b1b1a55839d4550edf1035a9bbdd9d2afe26db0e (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
Object ancestors := method(
prototype := self proto
if (prototype != Object) then (
writeln("Slots of ", prototype type, "\n-------------")
prototype slotNames foreach(slotName, slotName println)
writeln
prototype ancestors
)
)
Animal := Object clone
Animal speak := method("ambiguous animal noise" println)
Duck := Animal clone
Duck speak := method("quack" println)
Duck walk := method("waddle" println)
disco := Duck clone
disco ancestors
|