Alex Martelli <aleax@aleax.it>: > All files have seek and write, but not on all files do they work -- and > the same goes for iteration. I.e., it IS something of a mess I've just had a thought. Maybe it would be less of a mess if what we are calling "iterators" had been called "streams" instead. Then the term "iterator" could have been reserved for the special case of an object that provides stream access to a random-access collection. Then you could say that a file object is a stream object that provides line-by-line access to an OS file. Other stream objects can be constructed that give access to the OS file in other units. That would all make sense without seeming to imply any multi-pass ability. Greg Ewing, Computer Science Dept, +--------------------------------------+ University of Canterbury, | A citizen of NewZealandCorp, a | Christchurch, New Zealand | wholly-owned subsidiary of USA Inc. | greg@cosc.canterbury.ac.nz +--------------------------------------+
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4