[Glass] isBytes for fixed pointers but superclass with bytes

Richard Sargent via Glass glass at lists.gemtalksystems.com
Tue Sep 2 09:41:48 PDT 2014


GLASS mailing list wrote
> In pharo, we don't have a class defined as "fixed pointers" with a "bytes"
> superclass. The following expression is empty in Pharo:
> 
> Smalltalk allClasses select: [ :each | (each isBytes and: [ each
> allSubclasses size > 0 ])
> and: [ each allSubclasses anySatisfy:  [ :aSubClass | aSubClass isBytes
> not
>  ] ]
>  ]
> 
> But in GemStone I have 2 exceptions:
> 
> anArray( AbstractCharacter, Float)
> 
> To me...it looks very strange that, for example, SmallDouble answers false
> to #isBytes. So I wonder.....since these are very strange scenarios, as a
> simple workaround, could we implement the correct #isBytes, #isVariable
> etc
> for those particular subclasses?

implementationFormat

"Returns the three least-significant bits of the receiver's format instance
 variable.  The values of those bits mean the following:

 0   OOP       non-indexable
 1   Byte      non-indexable
 2   NSC       non-indexable
 3   Special   non-indexable
 4   OOP       indexable
 5   Byte      indexable"

^ format bitAnd: 16r7


If you inspect the format of these classes, you will see they are specials.
Their oop fully defines each object. Questions like #isBytes is more
meaningful (and useful) when addressed to things like collections.




--
View this message in context: http://forum.world.st/Glass-isBytes-for-fixed-pointers-but-superclass-with-bytes-tp4775703p4775819.html
Sent from the GLASS mailing list archive at Nabble.com.


More information about the Glass mailing list