[3.9] Invisible method, missing changeset, backporting?

Bert Freudenberg bert at impara.de
Mon Mar 20 18:19:27 UTC 2006


Am 20.03.2006 um 16:25 schrieb Adrian Lienhard:
>
> The change is quite simple, for pre 3.9, the attached changeset  
> should work (note, #category: duplicates the implementation in  
> ClassDescription, hence should probably be removed there).

Better not - who knows who patched that in 3.8 ;-)

> The actual trick is to implement #category as follows in Class:
>
> category
> 	category ifNotNil: [
> 		((SystemOrganization listAtCategoryNamed: category) includes:  
> self name)
> 			ifTrue: [ ^category ] ].
> 	category := super category.
> 	^category
>
> It uses the ivar as a cache to make a guess (which is quite fast)  
> and only falls back to the old, slow behavior of looking through  
> the whole system category list if this fails.
>
> The change in 3.9 does the same but also for the class Trait. To do  
> this, there is a trait that is shared between Class and Trait.  
> Latter additionally has a new ivar (Class had this already defined,  
> but was not used, why?).

No idea ... maybe the environments work needed it?

Interestingly, in my 3.8 image there are a handful of classes having  
that inst var set:

	Class allSubInstances select: [:ea | (ea instVarNamed: #category)  
notNil]

	(CodeHolder Environment InflateStream ClassDescription Class  
MarqueeMorph FishEyeMorph FatBitsPaint ColorPickerMorph TextStyle  
DigitalSignatureAlgorithm SecureHashAlgorithm ThirtyTwoBitRegister)

> <categoryspeedup.cs>

In Class>>category:, shouldn't the category be stored as Symbol?  
Also, we could just call super, as in #category. I attached a  
changeset which does this.

- Bert -

-------------- next part --------------
A non-text attachment was scrubbed...
Name: categoryspeedup-al.1.cs.gz
Type: application/x-gzip
Size: 427 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20060320/1bb9016f/categoryspeedup-al.1.cs.bin


More information about the Squeak-dev mailing list