Here's a teeny tiny Christmas present:
ANSI-compatible instance creation methods
for RunArray.
'From Pharo9.0.0 of 11 May 2020 [Build information: Pharo-9.0.0+build.293.sha.d27b9cd0a533a234cd3491ce7db3c2ce7085e3a5 (64 Bit)] on 24 December 2022 at 5:14:53.947536 pm'!

!RunArray methodsFor: 'adding' stamp: 'RichardAnthonyOKeefe 12/24/2022 17:05'!
add: value
	^self addLast: value! !


!RunArray class methodsFor: 'instance creation' stamp: 'RichardAnthonyOKeefe 12/24/2022 17:12'!
with: x1 with: x2 with: x3 with: x4
	"ANSI method for creating collections"
	"RunArray with: #f with: #e with: #e with: #d"
	^(self new) add: x1; add: x2; add: x3; add: x4; yourself! !

!RunArray class methodsFor: 'instance creation' stamp: 'RichardAnthonyOKeefe 12/24/2022 17:13'!
withAll: aCollection
	"ANSI method for creating collections"
	"RunArray withAll: #(f e e d  t h e  a d d e r)"
	^(self new: aCollection size) removeAll; addAll: aCollection; yourself! !

!RunArray class methodsFor: 'instance creation' stamp: 'RichardAnthonyOKeefe 12/24/2022 17:12'!
with: x1
	"ANSI method for creating collections"
	"RunArray with: #f"
	^(self new) add: x1; yourself! !

!RunArray class methodsFor: 'instance creation' stamp: 'RichardAnthonyOKeefe 12/24/2022 17:12'!
with: x1 with: x2
	"ANSI method for creating collections"
	"RunArray with: #f with: #e"
	^(self new) add: x1; add: x2; yourself! !

!RunArray class methodsFor: 'instance creation' stamp: 'RichardAnthonyOKeefe 12/24/2022 17:12'!
with: x1 with: x2 with: x3
	"ANSI method for creating collections"
	"RunArray with: #f with: #e with: #e"
	^(self new) add: x1; add: x2; add: x3; yourself! !

Reply via email to