lua-users home
lua-l archive

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


>>>>> "Dirk" == Dirk Laurie <dirk.laurie@gmail.com> writes:

 Dirk> I've been a Lua user for almost ten years, and I've succeeded in
 Dirk> understanding and sometimes using every language addition in that
 Dirk> time. Not so with <toclose>.

 Dirk> My perceptions about it are:

 Dirk> 1. It solves a problem encountered by a very small fraction of
 Dirk> Lua users.

Maybe so, but it's a problem that lacks other reasonable solutions.

 Dirk> 2. Although it looks like a property of a variable, i.e. a name,
 Dirk> it is a property of the associated value.

No. This is flat wrong. It is explicitly a property of the variable, and
it is linked to the scope of the variable.

 Dirk> 3. All variables declared <toclose> must have a metatable with a
 Dirk> __close metamethod, otherwise nothing different happens anyway.

Variables don't have metatables, values do. Values assigned to toclose
variables do need to have this metamethod, yes.

 Dirk> 4. Therefore they must be either tables or full userdata.

Correct. So?

-- 
Andrew.