lua-users home
lua-l archive

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


On Thu, Sep 18, 2014 at 5:32 AM, Udo Schroeter <udo.schroeter@gmail.com> wrote:
> It's an implementation detail that bleeds through into userland big time,
> though. From the pairs()/ipairs() distinction through to the way table sizes
> are calculated (which I believe was the thing that set off this discussion
> in the first place).
>
> On the one hand I totally understand where the resistance is coming from,
> but on the other hand it's one of these fundamental decisions that are a big
> source of WTFs for new users. Of course experienced devs reflexively code
> around it and never encounter any problems.
>
> Personally, my take-away from this when I learned Lua was to just not use
> numerical indices anywhere - and with iterators that works out just fine.
> But it's a gotcha.
>
> My reason for _not_ keeping these thoughts to myself was the impression that
> this is a speculative thread, not an actual feature request.

I'm not resisting change. I'm actually not SEEING what's actually
different between your proposal and reality. The only possible actual
change I can see that you MIGHT be speculating on (but not actually
saying anything about) is making the # operator return the number of
elements in the table rather than the index of the highest element in
the sequence. The rest... I guess I'm missing something.

/s/ Adam