On 18 Jul 2014, at 09:47, Marcus Denker <[email protected]> wrote:
> > On 18 Jul 2014, at 08:14, Marcus Denker <[email protected]> wrote: > >>>> >>>> I have added a first GlobalVar hierarchy… it has already the code >>>> generation methods but Opal is not yet forwarding >>>> code generation (and the compiler does not yet compile bindings with the >>>> subclass). >>>> >>> >>> update 40 095 contains changes to deeper integrate first class variables >>> (Slots and first class Globals) int the system. >>> >>> 1) Both the binding in "Smalltalk globals" as well as all Class Variables >>> are now instances of GlobalVariable. >>> (I want to have both GlobalVariable and ClassVariable, but that is for >>> later) >>> >>> e.g. >>> >>> Object binding class >>> (SmalltalkImage classVariableNamed: 'ShutDownList') class >>> >>> all the Slots and Globals understand >>> >>> #definingClass -> returns the class defining the variable or >>> "nil" for true globals >>> #usingMethods -> all methods reading or writing the variable >>> in Pharo4 #102: -> CompiledMethod now has working #readsSlot:, #writesSlot: besides #accessesSlot: (for speed we could dispatch them to the Slot so slots could use faster ways than AST searching… but then, speed is fast after the AST is cached… #usingMethods already does that for IvarSlot to avoid creating the AST for all methods of a class, which indeed is slow the first time) e.g. (Point>>#setX:setY:) writesSlot: (Point slotNamed: #y) —> true Point methodsWritingSlot: (Point slotNamed: #x) —> {Point>>#bitShiftPoint:. Point>>#setX:setY:. Point>>#setR:degrees:} (Point slotNamed: #x) usingMethods size —> 60 (SmalltalkImage classVariableNamed: 'ShutDownList') usingMethods size —> 7 -> after having fun with #usingMethods on variables, I added #senders and #implementors to Symbol. So now one can use (e.g. nice for doing Demos): #+ senders size. #+ implementors inspect Marcus
