[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: improving the module function - package.clean
- From: David Manura <dm.lua@...>
- Date: Thu, 17 Sep 2009 01:51:43 -0400
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.