[self-interest] Another naive question (weakness)
vi.ki at worldonline.cz
Thu Aug 22 13:20:49 UTC 2002
> > If an object with code (method or block) is assigned into read/write
> > slot, then readed from the the slot, it is simply returned, not
> > isn't it?
> Normally, you cannot create a literal method object and access it. Self
> automatically evaluates a method when it sees brackets ( ... ). The only
> exception is the method slot initialization construction (| method = (
> ^self ) |). But when you try to access method slot it is evaluated and
> the result of the method invocation is returned.
> Blocks behave differently, they are always evaluated manually by sending
> one of the 'value', 'value:', ... messages to a block object.
> Though you are still able to access method objects programmatically. You
> need to use mirrors for that.
Thank you, now it is clear and much better than I expected.
Now something about weak references - there is absolutely nothing about it
in "The Self 4.0 Programmers Reference Manual", but I suppose this feature
_must_ be in Self. Am I right? What kind of references can be weak? Only
indexed references in vector of objects? By which objects is such weak
reference replaced by GC, by nil or by some special object (#dead)? Is some
message sent to owner of weak object when one is expired?
Exists something more detailed about Self than ""The Self 4.0 Programmers
More information about the Self-interest