[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua 5.2 Length Operator and tables (bug?)
- From: Miles Bader <miles@...>
- Date: Tue, 17 Apr 2012 10:31:32 +0900
chris <csrl@gmx.com> writes:
> I would be interested to understand the intended purpose of the
> length operator for tables then. As I see it, you have to know that
> the table is a sequence in order to find the length operator useful.
Yes (but of course, it's the usual case that one does know how one's
data structures are structured ... :)
> If you know it is a sequence, that means you could have already
> tracked the length manually
Sure, you _could_, but why would you want to, when the # operator does
the right thing, and is more convenient (and in many cases more
efficient)?
-miles
--
"Suppose He doesn't give a shit? Suppose there is a God but He
just doesn't give a shit?" [George Carlin]