[Pharo-dev] becomeCompactSimplyAt: and Integer class>>initialize

Martin Dias tinchodias at gmail.com
Wed Aug 7 10:40:12 EDT 2013


Hi

1)

I'm working on an issue related to compact classes index and I discovered
that behaviours implement #becomeCompactSimplyAt:, which has this comment:

"Make me compact, but don't update the instances.  *For importing segments*
."

This made me think that it's no longer needed in the image since we removed
ImageSegment. In other hand, I don't know why sender might decide if the
instances of the class must be updated or not... do you?



2)

The only users in Pharo 3 are in:

Integer class >>
initialize
"Integer initialize"
 "Ensure we have the right compact class index"

"LPI has been a compact class forever - just ensure basic correctness"
 (LargePositiveInteger indexIfCompact = 5) ifFalse:[
(Smalltalk compactClassesArray at: 5)
ifNil:[LargePositiveInteger becomeCompactSimplyAt: 5]
 ifNotNil:[self error: 'Unexpected compact class setup']].

(LargeNegativeInteger indexIfCompact = 4) ifFalse:[
 (Smalltalk compactClassesArray at: 4)
ifNil:[LargeNegativeInteger becomeCompactSimplyAt: 4]
ifNotNil:[self error: 'Unexpected compact class setup']].


Now, looking for other users of #indexIfCompact, I see that here is the
only place in the image where compact indexes are checked/fixed.



3)

I wonder if we should remove both #becomeCompactSimplyAt: and Integer
class>>initialize.



Thank you in advance.
Martín
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pharo.org/pipermail/pharo-dev_lists.pharo.org/attachments/20130807/efe2aa65/attachment-0002.html>


More information about the Pharo-dev mailing list