lua-users home
lua-l archive

Re: improving the module function - package.clean

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


On Wed, Sep 16, 2009 at 7:07 AM, Jim Jennings wrote:
> I would love to see Lua 5.2 adopt your suggestion of having 'require'
> place the loaded module table into the right place.
In some module systems, certain modules utilize the import mechanism
to apply a special side-effect into the caller. A Perl style way of
writing
 module(..., package.strict)
would be
 module(...)
 import "strict" -- i.e. require "strict" : __import()
Here, *every* instance of "import 'strict'" would apply a side-effect
into its caller environment, unlike "require 'strict'" in Lua 5.1
which permits no side-effects after its first call.

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