" Smalltalk/ReadStream.st -*- Smalltalk -*- " ReadStream : PositionableStream () ReadStream next [ " Answer the next object in the Stream represented by the receiver. Fail if the collection of this stream is not an Array or a String. Fail if the stream is positioned at its end, or if the position is out of bounds in the collection. " ^self atEnd ifFalse: [ | object | object := collection at: position. position := position + 1. object ] ] ReadStream readStream [] "----------------------------------------------------------------" SequenceableCollection readStream [ ^ReadStream on: self ]