equal
deleted
inserted
replaced
1607 |
1607 |
1608 asDictionary |
1608 asDictionary |
1609 "return a Dictionary with the receiver collection's elements, |
1609 "return a Dictionary with the receiver collection's elements, |
1610 using the original keys of the receiver as dictionary key. |
1610 using the original keys of the receiver as dictionary key. |
1611 Notice: this is redefined in Dictionary, where it returns the receiver. |
1611 Notice: this is redefined in Dictionary, where it returns the receiver. |
1612 Use asNewDictionary, if you intent to modify the returned collection. |
1612 Use asNewDictionary, if you intend to modify the returned collection. |
1613 See associationsAsDictionary if you already have a collection of associations" |
1613 See associationsAsDictionary if you already have a collection of associations" |
1614 |
1614 |
1615 |d| |
1615 |d| |
1616 |
1616 |
1617 d := Dictionary new. |
1617 d := Dictionary new:self size. |
1618 self keysAndValuesDo:[:k :v | d at:k put:v]. |
1618 self keysAndValuesDo:[:k :v | d at:k put:v]. |
1619 ^ d |
1619 ^ d |
1620 |
1620 |
1621 " |
1621 " |
1622 #(10 20 30 40 50 60 70 80 90) asDictionary |
1622 #(10 20 30 40 50 60 70 80 90) asDictionary |