Skip to content

Commit

Permalink
Add Array>>#fillFrom:with:
Browse files Browse the repository at this point in the history
  • Loading branch information
gcotelli committed Aug 8, 2023
1 parent 870b43a commit 0106ed8
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions source/Buoy-Collections-GS64-Extensions/Array.extension.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Extension { #name : #Array }

{ #category : #'*Buoy-Collections-GS64-Extensions' }
Array >> fillFrom: aCollection with: aBlock [

| index |
index := 0.
aCollection do: [ :each |
self at: (index := index + 1) put: (aBlock value: each) ]
]

0 comments on commit 0106ed8

Please sign in to comment.