Frank Shearar uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-fbs.517.mcz==================== Summary ====================
Name: Collections-fbs.517
Author: fbs
Time: 2 May 2013, 9:05:50.998 pm
UUID: f915b900-af5c-491f-a700-0f9899f72044
Ancestors: Collections-fbs.516
Separating with whitespace will _always_ work, but at the cost of increased ugliness when not needed. We know that having a binary selector as a key breaks printing, so let's special-case that. At some later stage we might need to revisit these two methods and add further special cases (or just use whitespace).
=============== Diff against Collections-fbs.516 ===============
Item was changed:
----- Method: Association>>printOn: (in category 'printing') -----
printOn: aStream
+ | arrow |
-
super printOn: aStream.
"If the key is a binary selector and we don't use whitespace, we will stream (key, '->') asSymbol."
+ arrow := (key isSymbol and: [key isBinary]) ifTrue: [' -> '] ifFalse: ['->'].
+ aStream nextPutAll: arrow.
- aStream nextPutAll: ' -> '.
value printOn: aStream!
Item was changed:
----- Method: Association>>storeOn: (in category 'printing') -----
storeOn: aStream
+ | arrow |
"Store in the format (key->value)"
aStream nextPut: $(.
key storeOn: aStream.
+ "If the key is a binary selector and we don't use whitespace, we will stream (key, '->') asSymbol."
+ arrow := (key isSymbol and: [key isBinary]) ifTrue: [' -> '] ifFalse: ['->'].
+ aStream nextPutAll: arrow.
- "If key is a binary selector and we don't use whitespace, we will stream (key, '->') asSymbol."
- aStream nextPutAll: ' -> '.
value storeOn: aStream.
aStream nextPut: $)!