[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Next Version of Lua? (__iter metamethod)
- From: Adrian Sietsma <adrian_groups@...>
- Date: Thu, 11 Jun 2009 01:20:11 +1000
John Hind wrote:
Ugg! Not a good choice, in my opinion! There is a "right choice" of iterator
for different types of object and it should be contextually selected not
having to remember whether to use pairs or ipairs.
Not true.
I often have multi-use tables, such that t[id] = t[n] = object.
I can then lookup objects by id, or iterate them with ipairs.
In this case, how would your code 'contextually select' the iterator ?
Apart from this consideration of principle, it is using two metamethods to
do a half-assed job that could be properly done with just one!
Is the solution half-assed, or your understanding of the problem ?
- References:
- Next Version of Lua?, Olivier Hamel
- Re: Next Version of Lua?, Jim Whitehead II
- Re: Next Version of Lua?, Olivier Hamel
- Re: Next Version of Lua?, Luiz Henrique de Figueiredo
- Re: Next Version of Lua? (again, \x## notation), Ico
- Re: Next Version of Lua? (again, \x## notation), Luiz Henrique de Figueiredo
- RE: Next Version of Lua? (__iter metamethod), John Hind
- Re: Next Version of Lua? (__iter metamethod), Luiz Henrique de Figueiredo
- RE: Next Version of Lua? (__iter metamethod), John Hind