[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Cleaning up iterators
- From: Antonio Vieiro <antonio@...>
- Date: Tue, 26 Jul 2011 21:10:01 +0200
I'm thinking of using iterator to iterate over the results of a SQL
query, something like:
for row in result("SELECT id,name FROM USER") do
if row.id == 3 then break end
but I need to "clean-up" the iterator when it finishes (i.e. after the
loop) or whenever I have a "break" or a "return" statement.
As far as I understand there's no way to do this, right?
Thanks in advance,