[squeak-dev] The Trunk: Collections-cmm.531.mcz

Chris Muller asqueaker at gmail.com
Sat Sep 7 17:13:12 UTC 2013


On Fri, Sep 6, 2013 at 7:56 PM, Levente Uzonyi <leves at elte.hu> wrote:
> On Fri, 6 Sep 2013, commits at source.squeak.org wrote:
>
>> Chris Muller uploaded a new version of Collections to project The Trunk:
>> http://source.squeak.org/trunk/Collections-cmm.531.mcz
>>
>> ==================== Summary ====================
>>
>> Name: Collections-cmm.531
>> Author: cmm
>> Time: 6 September 2013, 2:26:33.695 pm
>> UUID: da0031c2-e1d3-4f49-a425-9808728e3f1a
>> Ancestors: Collections-ul.530
>>
>> - Remove redundant isVariableBinding override.
>> - Characters can now be tested for isAscii.
>> - Dictionary's and Set's made proxy-friendly.
>
>
> What about the other Sets and Dictionaries?

Not sure which ones you're referring to, but I'm just being
conservative -- I haven't had a case to observe a problem to fix for
any other types.

>> - Remove redundant isLiteral override.
>> - Allow #asMutator to work for getter or setter selectors.
>>
>> =============== Diff against Collections-ul.530 ===============
>>
>> Item was added:
>> + ----- Method: Number>>compareSafely: (in category '*collections') -----
>> + compareSafely: aNumber
>> +       "Override method to compare the receiver with aNumber to determine
>> its position in a human-readable list without unnecessarily agitating
>> proxies."
>> +       ^ self < aNumber!
>
>
> You assume that the argument is a Number, but you don't check if it really
> is a Number or not. If it's not, then you must use the implemtation in
> Object.

Unfortunately, this whole thing did not really accomplish what I
wanted because the Proxy could be the argument instead of the
receiver.   Still, this factoring is better than what it was, and it
at least helps for Proxy's to be able to override #compareSafely:, but
not water tight..   :(

The real solution for me was to override Dictionary>>#inspectorClass
to simply return BasicInspector.  I may want ot turn that into a
preference at some point.


>> Item was added:
>> + ----- Method: String>>compareSafely: (in category '*collections') -----
>> + compareSafely: aString
>> +       "Compare the receiver to aString in a way that will not agitate
>> proxies."
>> +       ^ self < aString!
>
>
> Same as with Number: you must check if the argument is a String or not,
> otherwise it's not a "Safe" comparison.
> Btw, I wonder if these methods should really be in Collections.
>
>
> Levente
>


More information about the Squeak-dev mailing list