On Sep 22, 2010, at 9:59 40AM, Adrian Lienhard wrote:

> Some notes:
> 
> - What should be answered for small ints? 1 sizeInMemory -->8. That's wrong. 
> Shouldn't this answer 0?

Philosophical question really, imo both 4 (Again, in 32bit images at least) and 
0 would be "correct" answers in their own ways. 8 is definitely wrong though :)
The method comment should probably highlight which definition is used.

> 
> - In the line contentBytes := contentBytes + (self basicSize * 
> bytesPerElement), why is contentBytes added because it should be always 0 
> because self class instSize should return 0 in case of variable classes. Or 
> do I miss something?
You can have instance variables in variable classes:

ArrayedCollection variableSubclass: #TallyArray
        instanceVariableNames: 'tally'
        classVariableNames: ''
        poolDictionaries: ''
        category: 'Collections-Arrayed'

TallyArray instSize 1
(TallyArray new: 5) basicSize 5

Sure, they're not used very often in Squeak/Pharo since become: is so slow, but 
there's no theoretical reason why you can't for example implement Set as a 
variable subclass with a tally inst var.

> 
> - Please remove the inline comment "inst vars"; if a comment is needed it 
> should go into the main comment.
I agree, should be self-explanatory.

Cheers,
Henry
_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

Reply via email to