The Trunk: Collections-fbs.517.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Collections-fbs.517.mcz

commits-2
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: $)!


Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Collections-fbs.517.mcz

Chris Muller-3
Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: Collections-fbs.517.mcz

Frank Shearar-3
On 2 May 2013 21:16, Chris Muller <[hidden email]> wrote:
> http://www.youtube.com/watch?v=DDZBzvTDhGU

I just wish my Polo was that new, and that clean!

frank