I’m using 2014.2511. I was just wondering why requiring physics sets a global variable, whereas requiring, e.g., widget and composer don’t.
local function testRequire(moduleName) require(moduleName) print(moduleName, \_G[moduleName]) end testRequire("physics") testRequire("widget") testRequire("composer")
The result of the above program is:
physics table: 0AC851C8 widget nil composer nil
In examples found on the official site and around the web, the result of a require is always assigned to a local variable. For physics this is actually not required as the above output shows that it sets a global.
Is there a specific reason why the physics module was designed to behave differently?