[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [ANN] Lua 5.4.0 (work1) now available
- From: albertmcchan <albertmcchan@...>
- Date: Tue, 13 Mar 2018 18:04:21 -0400
On Mar 13, 2018, at 4:50 PM, Dirk Laurie <dirk.laurie@gmail.com> wrote:
> 2018-03-13 22:38 GMT+02:00 Rodrigo Azevedo <rodrigoams@gmail.com>:
>
>> the (new) syntax could be extended to
>> non-tables
>>
>> a = function(x) return x end
>> a = undef
>
> This is perfectly legal if a is global, since a=undef is equivalent to
> _ENV.a = undef
> It is an error if a is local, or if a does not in fact currently have a value.
>
Based on above example, local variable can not set to undef ?
Is this (new) syntax for performance ? (less memory churn ?)
I don't fully get it.
If user do not want "holes" in table, false can be used instead of nil
the feature seems just a new mapping (false -> nil, nil -> undef)
(I thought false were introduced for removing holes in table)