From 0106ed83f7b106221b0136c40b03816115a852e4 Mon Sep 17 00:00:00 2001 From: Gabriel Omar Cotelli Date: Tue, 8 Aug 2023 09:59:44 -0300 Subject: [PATCH] Add Array>>#fillFrom:with: --- .../Array.extension.st | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 source/Buoy-Collections-GS64-Extensions/Array.extension.st diff --git a/source/Buoy-Collections-GS64-Extensions/Array.extension.st b/source/Buoy-Collections-GS64-Extensions/Array.extension.st new file mode 100644 index 0000000..e8b3ab5 --- /dev/null +++ b/source/Buoy-Collections-GS64-Extensions/Array.extension.st @@ -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) ] +]