*** user24 has joined #io | 15:19 | |
user24 | If I have A := Object Clone; A v := 42; A := Object clone; A m := method(A v) | 15:27 |
---|---|---|
user24 | wait, minor modification | 15:27 |
user24 | If I have A := Object Clone; A v := 42; B := Object clone; B m := method(A v) | 15:27 |
user24 | How can object B lookup object A? | 15:28 |
*** Dracoliat has joined #io | 19:26 | |
*** Dracoliat has left #io ("Closing Window") | 19:26 | |
jer | user24, through the same mechanism you can look up "clone" on Object | 19:39 |
jer | so inside method() you have a locals object, it's linked to the target context (the instance of the object it's being called on) which itself is linked to Object, which is linked to Lobby... Lobby can find A because A was defined in the context of the Lobby | 19:40 |
user24 | jer: So first, the name is looked up depth first recursively through all the protos and then the locals? | 19:41 |
jer | sorry was afk | 20:17 |
jer | yes, so inheritence happens depth first, in a list of protos | 20:17 |
jer | starting at the locals | 20:17 |
jer | locals on method()s checks the context of the receiver next, and depth first from there | 20:18 |
user24 | jer: thank you! | 20:20 |
jer | sure no problem | 20:27 |
*** user24 has quit IRC | 20:40 |
Generated by irclog2html.py 2.14.0 by Marius Gedminas - find it at mg.pov.lt!