The Inbox: Collections-cmm.382.mcz

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

The Inbox: Collections-cmm.382.mcz

commits-2
A new version of Collections was added to project The Inbox:
http://source.squeak.org/inbox/Collections-cmm.382.mcz

==================== Summary ====================

Name: Collections-cmm.382
Author: cmm
Time: 19 September 2010, 3:46:29.35 pm
UUID: 65fbb7e5-4fa4-4da5-b790-39bd15129d55
Ancestors: Collections-ul.381, Collections-cmm.366

Integration of Brent Pinkney's object-concatenation enhancement.  This extends the Object API to allow elegant object concatenation, just as Exceptions may be easily concatenated with the #, (comma) selector, now any object may, as well:

  object1, object2  --> "{ object1.  object2 }"

and, equally, with other collections:

  { object1.  object2 }, object3 --> "{ object1.  object2. object3 }"

=============== Diff against Collections-ul.381 ===============

Item was changed:
  ----- Method: Collection>>, (in category 'copying') -----
  , aCollection
+
+ ^ self copy addAll: aCollection asCollection; yourself!
- ^self copy addAll: aCollection; yourself!

Item was added:
+ ----- Method: Collection>>asCollection (in category 'converting') -----
+ asCollection
+
+ ^ self!

Item was added:
+ ----- Method: Object>>, (in category '*collections-concatenation') -----
+ , anObjectOrCollection
+
+ ^ self asArray, anObjectOrCollection asCollection!

Item was added:
+ ----- Method: Object>>asArray (in category '*collections-concatenation') -----
+ asArray
+
+ ^ Array with: self
+
+ !

Item was added:
+ ----- Method: Object>>asCollection (in category '*collections-concatenation') -----
+ asCollection
+
+ ^ self asArray!

Item was changed:
  ----- Method: SequenceableCollection>>, (in category 'copying') -----
  , otherCollection
  "Concatenate two Strings or Collections."
 
  ^ self copyReplaceFrom: self size + 1
   to: self size
+  with: otherCollection asCollection
-  with: otherCollection
  "
  #(2 4 6 8) , #(who do we appreciate)
+ ((2989 printStringBase: 16) copyFrom: 4 to: 6) , ' boy!!'
- ((2989 storeStringBase: 16) copyFrom: 4 to: 6) , ' boy!!'
  "!

Item was added:
+ ----- Method: String>>asCollection (in category 'converting') -----
+ asCollection
+ ^ Array with: self!