[squeak-dev] The Trunk: System-fbs.535.mcz

Frank Shearar frank.shearar at gmail.com
Tue May 21 20:33:35 UTC 2013


On 21 May 2013 21:23,  <commits at source.squeak.org> wrote:
> Frank Shearar uploaded a new version of System to project The Trunk:
> http://source.squeak.org/trunk/System-fbs.535.mcz
>
> ==================== Summary ====================
>
> Name: System-fbs.535
> Author: fbs
> Time: 21 May 2013, 9:22:56.014 pm
> UUID: f41c3215-fd9f-478a-a4db-0bea16b3b456
> Ancestors: System-fbs.534
>
> Environmentally-aware SystemNavigation didn't look at the metaclass heirarchy, so couldn't find class-side implementors, for instance.
>
> =============== Diff against System-fbs.534 ===============
>
> Item was changed:
>   ----- Method: MethodReference>>printOn: (in category 'printing') -----
>   printOn: aStream
> +       | actualClass |
>         "Print the receiver on a stream"
> +       actualClass := classSymbol asString.
> +       classIsMeta ifTrue: [actualClass := actualClass, ' class'].
> -
>         super printOn: aStream.
> +       aStream nextPutAll: ' ', actualClass, ' >> ', methodSymbol printString.!
> -       aStream nextPutAll: ' ', self actualClass name, ' >> ', methodSymbol!

I had intended to make this a separate commit. With Environments,
"actualClass" is broken because it means "look up this classSymbol in
Smalltalk globals". The tests are all Environment-specific (as is
right and proper), so this just makes the MethodReference print
properly again. (Without this change you'd see something like 'a
MethodReference (nil >> #foo)'.)

However, going forwards we probably want to make a MethodReference
Environment-aware, by adding the Environment within which this
referenced method lives.

Then #actualClass will look something like this:

actualClass
    ^ self environment at: classSymbol ifPresent: [ :actualClass |
        classIsMeta
            ifTrue: [ actualClass classSide ]
            ifFalse: [ actualClass ] ]

(Or maybe we should rather use the as-yet-unwritten
#valueOf:ifPresent:, rather than the legacy Dictionary protocol).

frank


More information about the Squeak-dev mailing list