[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: what to make of this fellow named __ipairs?
- From: "Stuart P. Bentley" <stuart@...>
- Date: Thu, 27 Jan 2011 05:06:03 -0800
?>Finally, `pairs` and `ipairs` are not essential functions, so we could
avoid the issue by just eliminating them (although that was tried and
I once again raise the suggestion of making ipairs- and pairs- functionality
2 more types of for loop ('for i, v over t do' and 'for k, v of t do'), with
the former using 'local i,v=1 while t[i] do k=t[i] <...> i=i+1 end'
semantics and the latter using 'local k,v = next(t) while t[k] do v=t[k]
<...> k=next(t,k) end'.
Also, shouldn't next(), pairs(), and ipairs() technically go in the "table"
library with unpack()?