lua-users home
lua-l archive

Re: [ANN] Lua 5.4.0 (alpha-rc1) now available

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> 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

AltStyle によって変換されたページ (->オリジナル) /