Re: __ipairs
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: __ipairs
- From: "Soni \"They/Them\" L." <fakedme@...>
- Date: 2018年3月16日 06:37:58 -0300
On 2018年03月16日 05:56 AM, Andrew Gierth wrote:
"Duane" == Duane Leslie <parakleta@darkreality.org> writes:
Duane> Hi,
Duane> A quick and dirty tuple implementation using the new
Duane> multi-uservalue userdata implementation.
[...]
>> for i,v in pairs(t) do print(i,v) end
A perfect example of why deprecating __ipairs was the wrong move. It
ought to be possible to make this code work with ipairs(t) as well, but
with no __ipairs metamethod it can't be done.
Uh, the only issue is that ipairs would "respect" nil, but otherwise it
does/should work.
But yes, being able to explicitly include nils in ipairs output, i.e.
with __ipairs, would be nice.
I don't think the Lua team wants to have both __ipairs and __index
respected by ipairs tho...
Do you know anything in Lua which respects *two* metamethods?
--
Disclaimer: these emails may be made public at any given time, with or without reason. If you don't agree with this, DO NOT REPLY.