lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]



True. Also, my non-existent idea was kinda dumb in that "__next" is really the last missing iterator metamethod, not "__in". 

Yes, we've all had this conversation before :)

I still think that the current (5.2) __pairs and __ipairs metamethods are a fairly good compromise.  But, there are places where I'd certainly prefer a __next to __pairs.  I'll still sometimes get into trouble by writing code designed to work on standard tables, only to hit bugs when lua_next fails on my userdata proxy tables.  It's never that hard to fix, of course -- but it does feel a bit inconsistent.  API functions like lua_getfield() respect proxies, so why not lua_next() as well?  

-Sven