[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: new "empty" value/type in Lua?
- From: Hisham <h@...>
- Date: Mon, 1 Jul 2013 16:16:29 -0300
On 1 July 2013 15:04, Roberto Ierusalimschy <roberto@inf.puc-rio.br> wrote:
>> 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?
If I'm following correctly, code that uses t[k] = nil to clean up
parts of a table would behave the same, but take up more memory,
unless modified to use table.delete() ? If so, that would turn a
"standard practice" into a compatible, but "bad practice"... I agree
with Javier that this would be a major change. I don't know if I like
the whole proposal or not, but this point I raised does sound like a
problem to me.
-- Hisham
http://hisham.hm/