lua-users home
lua-l archive

Module system curiosity

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


It seems to me that the 5.1 module system does not actually provide
the type of modulariziation with which I've grown to be familiar.
I would expect that this sequence:
 local require = require
 module(...)
 require "lpeg"
puts the lpeg module into the module table. But in my testing, it
ends up in the global table of the main program. I find this behavior
rather surprising. (On the other hand, if "require" would modify the
module table, some way to suppress that leakage of an implementation
detail would be desirable.)

AltStyle によって変換されたページ (->オリジナル) /