Last modified: 2013-01-10 19:55:33 UTC
It's inelegant to have to explicitly export things when there is already a "local" keyword. Why not export everything non-local by default? If that is not possible for some reason, why not initialize an empty table for each module, assign it a reserved name, and export it implicitly? I imagine something like this implicitly wrapping each module: local module = {}; <<module code>> return module;
If you called the default module object "this", it'd behave exactly like a JavaScript constructor. I'd still prefer the former option, though (i.e., relying on the local keyword to assign to module or global scope).
I did not articulate myself clearly in this report and bug 39610 has meanwhile become the locus of the conversation about scoping, so I'm closing this as a duplicate of that bug. *** This bug has been marked as a duplicate of bug 39610 ***