lua-users home
lua-l archive

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

>What is the scope of the "global in x" statement ?  ie if some
>idiot writes a function that says "global in x" then returns, I
>am hoping if I call that function it will not alter what my current
>global scope is set to?

Like everything else in Lua (now!), scope is purely lexical. So your hopes
are founded.

>Also, how do you reset globals to be truly global... something like
>global in global ?

The closest thing is "global in globals()" but the best solution is to
use do..end scopes.

>I don't really understand what the difference is, as userdata is simply an
>arbitrary 32 bit value anyway?  Does this just imply the lightweight
>userdata cannot have a metatable?

Yes, lightweight userdata cannot have a metatable. They're much like numbers.
Some people were using doubles to store pointers to overcome perceived
"inefficiencies" in userdata. Lightweight userdata avoids these uglys hacks.
>Cool.  Obviously the question is, when is work5 out ? :)

It would be 5.0 work0, but probably will be 5.0 alpha.