[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: new "empty" value/type in Lua?
- From: "Pierre Chapuis" <catwell@...>
- Date: Mon, 1 Jul 2013 21:41:59 +0200
>> Couldn't a lot of ambiguity and unexpected behavior avoided by keeping
>> nil but introducing two new functions to the table library called
>> "table.has(t,key)" and "table.delete(t,key,[to])" - and dropping the
>> deletion via assigning nil?
> At last something new and worth a discussion. Does anyone see problems/
> incompatibilities/etc. with this?
Couldn't we not just finally add a real sequential type to the language?
Something that has a well-defined length *all the time*, no issue with
holes and can be detected just by using type() on it?
I don't really care if it is implemented with a table, a field called
"n" and a few sanity checks on insertion, and I don't really care
what syntax would be used, but it would solve so many issues I don't see
any reason not to do it.