The problem of dynamic inheritance

cyberbaixing cyberbaixing at yahoo.com.cn
Tue Jan 13 18:17:50 UTC 2004


Thanks, Jecel. Your analysis is very helpful to me! ^_^

I have some questions again when read your answer. Would you please 
give me some guidance?

1.You point out my problem is plain inheritance but not the dynamic 
one. 

> > a _Define: (|
> >         f = ('a' printLine. p:b. f).
> >
> > |)
> 
> Note that this object doesn't understand either the 'p:' nor 
the 'b' 
> messages. And the final 'f' will cause infinite recursion.

I want to know why the object a doesn't understand 'p:' and the 'b' 
messages? Doesn't this clause pass the syntax check? 
Why the final 'f' will cause endless recursion? Are there other cases 
also cause infinite recursion? How can I avoid them?
How can I accomplish the same result of resends by dynamic 
inheritance?

2.
c _Define: (|
        p*<- a.
        b = b.
        f = ('c' printLine. resend.f).
|)
In definition of c, I can understand the clause 'p*<- a.'. It means a 
is the parent object of c. But the clause'b =b.', Does it also mean b 
is a parent of c?

Else, I don't understand why the output of c f is 
c 
a 
c 
b
'b'
Why c appears two times? I guess it is related with the function 
printLine since if I delete it, the output has no any "c". 
Why object a works this time without the result of a f which is:
 a
 No 'b' slot found in a slots object.
Why b appears two times but with different forms?

Thanks,
Xing







More information about the Self-interest mailing list