lua-users home
lua-l archive

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

On Tue, Jun 28, 2016 at 12:15 PM, Coda Highland <> wrote:
> On Tue, Jun 28, 2016 at 10:12 AM, Roberto Ierusalimschy
> <> wrote:
>>> I find this particular whirlpool to be substantially more relevant
>>> than many of the oft-rehashed debates on lua-l. The outcome doesn't
>>> impact me PERSONALLY because I don't have any code that relies on the
>>> behavior of nils in tables (I don't remember if I even use #t in my
>>> code without going and looking; my use case doesn't even need linear
>>> sequences because everything's a map), but I think that finding a
>>> satisfying resolution to what is widely considered to be a wart would
>>> be good for everyone.
>> +1! (The only missing detail is a satisfying resolution :-)
>> -- Roberto
> Heh, yes, that thought went through my mind as I was writing it as well.
> It's a little telling that you're chipping into the discussion. :)
> /s/ Adam

I don't see the wart, unless you were to say that table.unpack is
returning a sequence.

To avoid confusion, it might be the case that there needs to be a
`sequence` library added to Lua. It would return a table with an
appropriate metatable, which included reasonable behavior for dealing
with nils, etc. If more robust, native performance is what is needed
then something like Tim's suggestion.

My motivation for saying anything is that it works pretty well now and
I would be nervous about breaking changes.

- Andrew Starks