Object subclass: #Interval instanceVariableNames: 'current start stop step'. Interval class methodsFor: 'creating' start: aStart stop: aStop step: aStep ^(self new) start: aStart; stop: aStop; step: aStep; yourself Interval methodsFor: 'private' start: anObject start := anObject. current := anObject. stop: anObject stop := anObject. step: anObject step := anObject. Interval methodsFor: 'accessing' hasNext ^current <= stop next | tmp | tmp = current. self hasNext ifTrue: [ current := current + step ]. ^tmp "Main!" | interval | interval := Interval start: 1 stop: 100 step: 10. [ interval hasNext ] whileTrue: [ Transcript show: interval next ].