Closed DarkWiiPlayer closed 5 years ago
@DarkWiiPlayer You can always wrap such an iterator API atop the existing API. Mind you, your for
loop can be more expensive than the current API usage because it requires creating a new Lua function (for the iterator) which is a GC object.
I noticed that the only way to receive the data seems to be to manually iterate until
'eof'
is returned.I think it would make sense to add a more user-friendly method that works with Luas generic for loop to iterate over the data.
Here's an example implementation:
Then the example of the readme could also be written as