do not expose global "yue"
johnd0e opened this issue · 3 comments
johnd0e commented
I noticed that using require("yue")
not only returns the module, but also sets global yue
variable:
> print(yue)
nil
> require"yue"
> print(yue)
table: 0x00698928
Is that intended?
pigpigyyy commented
Yes, it's intended and done by the Lua C-API from here for Lua version above 5.1
Line 47 in b3d021e
and here for Lua 5.1
Yuescript/src/yuescript/yuescript.cpp
Line 382 in b3d021e
So you think it is more of polluting the global env instead of offering convenience?
johnd0e commented
So you think it is more of polluting the global env instead of offering convenience?
Yes, exactly, that is my opinion.
pigpigyyy commented
OK, got this issue fixed by lastest commit. After all, it won't cost much effort to manually expose yue as global variable.