Hi guys,
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?
Thoughts? Thanks, Mariano http://marianopeck.wordpress.com _______________________________________________ Glass mailing list [hidden email] http://lists.gemtalksystems.com/mailman/listinfo/glass |
Ok...I answer myself. Today I found #isBytesOrSpecial. On Mon, Sep 1, 2014 at 11:09 PM, Mariano Martinez Peck <[hidden email]> wrote:
Mariano http://marianopeck.wordpress.com _______________________________________________ Glass mailing list [hidden email] http://lists.gemtalksystems.com/mailman/listinfo/glass |
Administrator
|
In reply to this post by GLASS mailing list
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. |
On Tue, Sep 2, 2014 at 1:41 PM, Richard Sargent via Glass <[hidden email]> wrote: GLASS mailing list wrote Thanks Richard, #implementationFormat was useful. Now I have a doubt with NSC. They answer true to #isVariable. However, I cannot seem to find a way to iterate its "variable" (not regular pointer slots). For example, in Pharo, I can do:
1 to: anObject basicSize do: [ :index | aBlock value: (anObject basicAt: index) ] How can I do that for a NSC, say Bag? Do I need to iterate it's instVars as a regular OOP non-indexeable? (instVarNames...etc...). Thanks,
Mariano http://marianopeck.wordpress.com _______________________________________________ Glass mailing list [hidden email] http://lists.gemtalksystems.com/mailman/listinfo/glass |
On Tue, Sep 2, 2014 at 10:47 AM, Mariano Martinez Peck <[hidden email]> wrote:
A Non-sequenceable Collection (NSC) is represented by internal GemStone data structures. It's instance variables won't get you anywhere. It looks like you will need to use #do: and just iterate over its contents.
_______________________________________________ Glass mailing list [hidden email] http://lists.gemtalksystems.com/mailman/listinfo/glass |
On Tue, Sep 2, 2014 at 3:13 PM, Richard Sargent <[hidden email]> wrote:
OK, that did the trick. Thanks for the help.
Mariano http://marianopeck.wordpress.com _______________________________________________ Glass mailing list [hidden email] http://lists.gemtalksystems.com/mailman/listinfo/glass |
In reply to this post by GLASS mailing list
Richard/Mariano, I believe that you can use #_at: to grab values from an NSC - you can see it's use in #_select: and freinds ... it is worth mentioning at this point in time that method beginning with '_' are considered private gemstone methods and we reserve the right to change the behavior of such methods without warning (including dropping them from the image) ...
sometimes an '_' method is the only way to do some things especially in the world of Fuel:) Dale On Tue, Sep 2, 2014 at 11:13 AM, Richard Sargent via Glass <[hidden email]> wrote:
_______________________________________________ Glass mailing list [hidden email] http://lists.gemtalksystems.com/mailman/listinfo/glass |
On Tue, Sep 2, 2014 at 6:50 PM, Dale Henrichs <[hidden email]> wrote:
Dale, I tried that before sending this email, same as _basicAt: etc... still get an error. Example: Bag new add: 1; add: 2; _at: 1 The only way I found is Richard one, that is, using #do:.
Exactly, that's what I found :)
Mariano http://marianopeck.wordpress.com _______________________________________________ Glass mailing list [hidden email] http://lists.gemtalksystems.com/mailman/listinfo/glass |
Free forum by Nabble | Edit this page |