Skip to content

Commit

Permalink
[PreSmalltalks] Add Dictionary class>>newFromArrayOfPairs:
Browse files Browse the repository at this point in the history
  • Loading branch information
shingarov committed Feb 11, 2024
1 parent fa8a6b4 commit ad891c9
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/PreSmalltalks/Dictionary.extension.st
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@ Dictionary >> lookupSymbol: aString ifAbsent: aBlockClosure [
^self at: aString ifAbsent: aBlockClosure
]

{ #category : #'*PreSmalltalks' }
Dictionary class >> newFromArrayOfPairs: pairs [
| assocs |
assocs := pairs collectPairs: [ :k :v | k->v ].
^self newFromAssociations: assocs
]

{ #category : #'*PreSmalltalks' }
Dictionary class >> newFromAssociations: anArray [

Expand Down

0 comments on commit ad891c9

Please sign in to comment.