Why must getSlot be invoked on self when used in a method?
"eebel_igman" <[email protected]> Mon, 23 Jul 2012 22:57:35 -0000
| Newsgroups | gmane.comp.lang.io |
|---|---|
| Message-ID | <[email protected]> |
Hello
I'm quite confused about the following behaviour:
Example:
Io> m := method(nil)
==> method(
nil
)
Io> getSlotReturnsNil := method(getSlot("m"))
==> method(
getSlot("m")
)
Io> getSlotOnSelfReturnsM := method(self getSlot("m"))
==> method(
self getSlot("m")
)
Io> getSlotReturnsNil
==> nil
Io> getSlotOnSelfReturnsM
==> method(
nil
)
Why does the invocation of getSlot("m") in getSlotReturnsNil return nil?
Best regards, Eebel