|
There's been discussion about initializing only certain parts of a module, or initializing it in a certain way.
I just came to try whether the title syntax would work, and it does!
require "module""feature" require "module"{ "feature1", "feature7" }Has anyone used this already (is this old stuff?) and is there any downsides to it? The idea would be for 'require' to attach a '__call' metamethod to the table it returns, which would in turn handle string and table-of-strings to initialize certain parts of the system.
function a() return function(str) print(str) end end a"hey"("hh")
hh
a"hey" "hh"
hh
a"hey""hh"
hh
a"hey"{ "hh", "uu" }
table: 0x309e20
-asko