Open simonbyrne opened 5 years ago
You need to call IteratorInterfaceExtensions.getiterator
on t
and then iterate over the thing that is returned by that (see here):
t = load(filename, sheet)
for row in getiterator(t)
@show row
end
should work.
We could probably also change things here so that the thing returned by load
can be iterated directly. It would change the story a bit, though, because right now load
is essentially lazy, and we wanted to make the thing returned by load
be iterable, it would need to have all the necessary column information in its type, and for that it would have to look at the content of the file...
Ah, I wasn't aware of IteratorInterfaceExtensions. I just found it odd that you could call collect
on it, but not iterate over it (since collect
is defined as "collecting an iterator").
Yeah, that is probably not super consistent... But I use collect
so often, that I just added a method to collect
. That in turn then calls getiterator
and the normal collect
.
gives