This is what Pinocchio had, resolving classes was done by looking them up in the current environment (so basically the Class name is just a code macro). This way we could add simple class scopes without too much effort.
I guess that would make the following code example a bit more complicated: oldDictClass := Dictionary. Dictionary := SmallDictionary. dict := Dictionary new. Dictionary := oldDictClass self assert: (dict isKindOf: SmallDictionary). but this is a rather bad feature in my eyes ;) On 2012-11-17, at 07:24, Fernando Olivero <[email protected]> wrote: > I love Marcus idea, classes aren't globals any more, and to access them is > simply another message send to a receiver: the environment. ( like the > lobby in Self ) . > > Fernando > > > On Sat, Nov 17, 2012 at 8:56 AM, Stéphane Ducasse <[email protected] >> wrote: > >>> The alternative to the current scheme would be to not hard-code the >> class at all in the method at compile time. >>> >>> Instead of looking up the class and compiling the shared literal >> association, we could compile a message send >>> to the current environment. >>> >>> self class environment at: #NameOfClass >>> >>> And it should be noted that this could be evaluated at Jit-compile >> time... the same is true for ivar offsets. There >>> is no reason why these should be visible at the image level. The image >> could talk about names and let the runtime >>> translator infrastucture do the lookups needed for making a static >> version that is fast. >> >> Yes I would like to measure that too. >> My benchmarks were to measure the worse case where we have to manually >> update the methods each time the class is modified. >> >> >>
