-
Notifications
You must be signed in to change notification settings - Fork 321
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using _ENV instead of self #177
Comments
It's easy enough to treat globals in scope of some local It's a bit trickier with top level "global" local function something(t)
_ENV = t
end
some_function(something)
-- Warn about unknown field or assume _ENV could have been assigned to by now?
os.unknown_function() This can be implemented, too (translate each global Then there is also an issue with Lua versions that don't have (I'm just listing reasons why this is not trivial to implement, I'm still adding this to TODOs.) |
Yes, I do understand that this is not an easy to implement feature. Thank you for the detailed response and for considering adding this feature request to your TODO list. |
Keeping this open until it's implemented. |
Any updates on this? |
I use _ENV as first argument to an object oriented Lua library and I get warnings on _ENV not being used and that the variables in the _ENV table are undefined.
Example:
local function f1(_ENV)
return xyz -- xyz is in the _ENV table
end
The text was updated successfully, but these errors were encountered: