Iterators: Would "rewind" be a good idea?

C

Charles D Hixson

I was reading through old messages in the list and came up against an
idea that I thought might be of some value:
"Wouldn't it be a good idea if one could "rewind" an iterator?"
Not stated in precisely those terms, perhaps, but that's the way I read it.

I appreciate that one could use a sequence rather than an iterator, and
that I don't understand the implementation issues. (They don't look
large, but what to I know?)

But would it be a good idea to have a rewind method for iterators? I
tend to think of them as mag tapes, and I was always wanting to rewind
those. Or skip to file n. (Well, that probably doesn't have any
relevance to the usage of iterators.)

OTOH, if this is a bother, it's almost always quite easy to create a new
iterator, it just feels less efficient. Still, I would use this much
more often that I would use reversed (which I've never wanted to use).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top