#REFACTORING by stefan
class: Collection
comment/format in:
#asKeysAndValues
#keysAndValues
changed: #associationsAsDictionary - now obsolete
--- a/Collection.st Fri Sep 14 17:14:50 2018 +0200
+++ b/Collection.st Fri Sep 14 18:18:41 2018 +0200
@@ -1861,8 +1861,11 @@
^ Dictionary withAssociations:self
"
- { 10->'ten' . 20->'twenty' . 30->'thirty'} asKeysAndValues
- "
+ { 'ten' -> 10 . 'twenty' -> 20 . 'thirty' -> 30 } asSet asKeysAndValues
+ { 'ten' -> 10 . 'twenty' -> 20 . 'thirty' -> 30 } asKeysAndValues
+ "
+
+ "Modified (comment): / 14-09-2018 / 18:00:02 / Stefan Vogel"
!
asLongIntegerArray
@@ -2174,17 +2177,11 @@
!
associationsAsDictionary
- "return a new Dictionary with the receiver collection's elements,
- which must be associations"
-
- ^ Dictionary withAssociations:self.
-
- "
- { 'ten' -> 10 . 'twenty' -> 20 . 'thirty' -> 30 } asSet associationsAsDictionary
- { 'ten' -> 10 . 'twenty' -> 20 . 'thirty' -> 30 } associationsAsDictionary
- "
-
- "Modified (comment): / 11-09-2018 / 12:24:30 / Stefan Vogel"
+ <resource: #obsolete>
+
+ ^ self asKeysAndValues.
+
+ "Modified (comment): / 14-09-2018 / 18:13:21 / Stefan Vogel"
!
copyAs:collectionClass
@@ -2237,6 +2234,9 @@
!
keysAndValues
+ "return an OrderedCollection with the receiver's associations as key->value pairs
+ using each element's key as dictionary key and value as dictionary value."
+
|assocs|
assocs := OrderedCollection new.
@@ -2248,6 +2248,8 @@
"
#(10 20 30 40 50 60) keysAndValues
"
+
+ "Modified (comment): / 14-09-2018 / 18:07:18 / Stefan Vogel"
!
literalArrayEncoding