An alternative to the first next paradigm described in this chapter is the following pair of messages:
reset Reset the generator to the start of the sequence, but do not produce a value.
next Return the next value from the sequence (which may be the first value if the last message sent to the receiver was reset).
Similarly, instead of returning nil to indicate the end of sequence, a message atEnd could be implemented by each generator. This message would return true if no more elements could be returned by the generator, and false otherwise. Discuss the advantages and disadvantages of these techniques. Support your opinions by rewriting some of the generators described in this chapter so that they use these alternatives.