[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: 'table' as fallback for tables
- From: Andrew Starks <andrew@...>
- Date: Tue, 28 Jun 2016 13:17:11 -0500
On Tue, Jun 28, 2016 at 12:15 PM, Coda Highland <chighland@gmail.com> wrote:
> On Tue, Jun 28, 2016 at 10:12 AM, Roberto Ierusalimschy
> <roberto@inf.puc-rio.br> 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
- References:
- Re: 'table' as fallback for tables, Philipp Janda
- Re: 'table' as fallback for tables, Coda Highland
- Re: 'table' as fallback for tables, Jay
- Re: 'table' as fallback for tables, Tim Hill
- Re: 'table' as fallback for tables, Philipp Janda
- Re: 'table' as fallback for tables, Tim Hill
- Re: 'table' as fallback for tables, Adrián Pérez de Castro
- Re: 'table' as fallback for tables, Andrew Starks
- Re: 'table' as fallback for tables, steve donovan
- Re: 'table' as fallback for tables, Coda Highland
- Re: 'table' as fallback for tables, Roberto Ierusalimschy
- Re: 'table' as fallback for tables, Coda Highland