An iterator that can be closed, and closes itself after you exhaust it through iteration.
An iterator that can be closed, and closes itself after you exhaust it through iteration. Not quite totally safe, since you can leak filehandles by leaving half-consumed iterators, but at least common things like foreach, mkString, reduce, sum, etc. will all result in close() being called.