[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: local variables and scope
- From: Roberto Ierusalimschy <roberto@...>
- Date: Thu, 25 Aug 2005 16:53:36 -0300
> This is very handy, as well as the related 'lua -w' flag.
>
> That said, if you have the misfortune to require a module, you are
> toasted:
We may assume C knows what it is doing, so strict.lua should be like this:
mt.__index = function (t, n)
- if not mt.__declared[n] then
+ if not mt.__declared[n] and debug.getinfo(2, "S").what ~= "C" then
error("variable '"..n.."' is not declared", 2)
end
return rawget(t, n)
Probably we will remove the -w flag in favor of -lstrict.
-- Roberto