> On 15 Aug 2015, at 12:56, Marcus Denker <[email protected]> wrote:
> 
> Ok, what I will do first is to add the API to Variables + Packages using the 
> propertyAt: format.
> 

Done for Globals and ClassVariables:

        https://pharo.fogbugz.com/f/cases/16223/Property-API-for-Globals 
<https://pharo.fogbugz.com/f/cases/16223/Property-API-for-Globals>


This works for both “Class Variable” meta objects:

        (ClassVariableTest classVariableNamed: #TestVariable)  propertyAt: 
#hello put: ‘you'.

and any Global in the “Smalltalk globals”:

        Object binding propertyAt: #hello put: ‘you'.

testPropertyAtPut

        | testValue classVariable |
        
        testValue := Date today.
        classVariable := self class classVariableNamed: #TestVariable.
        
        classVariable propertyAt: #testKeySelector put: testValue.
        self
                assert: (classVariable propertyAt: #testKeySelector)
                equals: testValue.

        TestVariable := 5. "of course changing the var does not change the 
property"
        
        self
                assert: (classVariable propertyAt: #testKeySelector)
                equals: testValue.
                
        classVariable removeProperty: #testKeySelector.
        self assert: classVariable properties isNil.


        Marcus

Reply via email to