lua-users home
lua-l archive

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


Rena <hyperhacker@gmail.com> writes:
>>> That seems like a bad example - in my experience, the index value in
>>> an ipairs loop is useful more often than not.
>>
>> I dunno, I seem to ignore the key in awful lot of for loops...
>>
>> Given the prevalence of "iterate over the values only" in many
>> languages, it is a bit odd that Lua doesn't have it.
>
> Well, Lua does have it - it's ipairs(). You just discard the first
> return value if you don't need it.

Er, no, that's my point:  I often use ipairs or pairs like that, but it
feels awkward.  It would be nicer to not have a dummy variable.

-Miles

-- 
Back, n. That part of your friend which it is your privilege to contemplate in
your adversity.