'[ENH]' repeat: 2

Mats Nygren nygren at sics.se
Thu Sep 7 05:45:38 UTC 2000


Hi,

A sometimes useful method, second version

/Mats

'From Squeak2.8 of 13 June 2000 [latest update: #2359] on 7 September
2000 at 8:36:33 am'!

!SequenceableCollection methodsFor: 'copying' stamp: 'mn 9/7/2000
08:35'!
repeated: anInteger
	"Appends the specified number of copies of self"
	"'ha' repeated: 5"
	| s |
	s := WriteStream on: (self class new: anInteger * self size).
	anInteger timesRepeat: [ s nextPutAll: self ].
	^ s contents.! !





More information about the Squeak-dev mailing list