lua-users home
lua-l archive

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


Hi there,

I am preparing a first release of some core parts of lubyk and cannot decide what is expected of "require" concerning global environment:

========= A (alter global)
local foo = require 'lub'
print(foo, lub)
--> table, table

========= B (do not touch global)
local foo = require 'lub'
print(foo, lub)
--> table, nil

========= C (do not touch global)
require 'lub'
print(lub)
--> nil

B and C are the same (just two common ways of using "require"). I feel that not touching global creates unexpected behavior in "C".

I feel "A" is the best solution but would like some community feedback on this...

Thanks for your feedback,

Gaspard