[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Why should not toclose be the default?
- From: Rodrigo Azevedo <rodrigoams@...>
- Date: Sun, 23 Jun 2019 13:29:12 -0300
Em dom, 23 de jun de 2019 às 08:59, Dirk Laurie
<dirk.laurie@gmail.com> escreveu:
>
> Is there any good, sound reason why a local variable needs to remain
> in limbo after it has gone out of scope?
>
> If not, we don't need <toclose> at all.
Overhead? Lua is also about performance.
Let's work the problem from scratch: Lua has 'local variables' that are ordered
local x,y = ...
local z = ...
They also have well defined 'lifetime', namely, they are lexically scoped and we
can use these properties to help us, which is the '<toclose>' (a bad
'word' choice) intent.
If you are supposing that the additional overhead from the compiler
and virtual machine to
check every 'out of scope' 'local variable' for a respective
'__toclose' method worth the
price, for me at least, it is an absolute win and must be included as
a default behavior.
Then, no more <toclose> or <const> dicussions for the moment.
Thanks!
--
Rodrigo Azevedo Moreira da Silva