lua-users home
lua-l archive

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

Why not use a simpler model for <close> variables as a simple
mechanism of a predictable call of __close() from its respective


  local x <close> =  whatever
  x = something -- it's OK
  local y <const,close>  = true
  -- y = false -- compile-time error

  -- going out-of-scope
  -- call __close(), if it exists, from 'something' value.
  -- call __close(), if it exists, from 'true' value.
end -- end-of-scope

Namely, it does not imply <const> or checks before variables are out-of-scope.
If we want <const>, just explicitly declares it.

Rodrigo Azevedo Moreira da Silva