lua-users home
lua-l archive

[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