'From Squeak3.6 of ''6 October 2003'' [latest update: #5424]'! SequenceableCollection subclass: #Cycle instanceVariableNames: 'precursor cycle ' classVariableNames: '' poolDictionaries: '' category: 'Collections-Sequenceable'! !Cycle methodsFor: 'private'! setPrecursor: preCollection cycle: cycCollection precursor _ preCollection. cycle _ cycCollection! ! !Cycle methodsFor: 'accessing'! at: anInteger ^ anInteger > precursor size ifTrue: [cycle atWrap: anInteger - precursor size] ifFalse: [precursor at: anInteger]! ! !Cycle methodsFor: 'accessing'! size ^ Float infinity! ! !Cycle methodsFor: 'printing'! printOn: aStream | title | title _ self class name. aStream nextPutAll: (title first isVowel ifTrue: ['an '] ifFalse: ['a ']); nextPutAll: title! ! !Cycle class methodsFor: 'instance creation'! new ^ self newWith: {nil}! ! !Cycle class methodsFor: 'instance creation'! newWith: aCollection ^ self newWith: aCollection preceding: #()! ! !Cycle class methodsFor: 'instance creation'! newWith: cycCollection preceding: preCollection ^ super new setPrecursor: preCollection cycle: cycCollection; yourself! !