[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [ANN] Lua 5.4.0 (alpha-rc1) now available
- From: Roberto Ierusalimschy <roberto@...>
- Date: Thu, 30 May 2019 12:48:24 -0300
> If true, then why not consider to default (mark) *all* 'local' to be
> collected as soon as possible (when out of scope), at the given
> reversed order, by the garbage collector (call __gc)?
function newfile (name)
local f = io.open(name)
return f
end -- oops; 'f' goes out of scope, file is closed.
Again, what goes out of scope are variables, not values.
-- Roberto