[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Basic, no fuss, no magic, foolproof module pattern. [Was: require, module, globals and "magic"]
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Thu, 19 Aug 2010 21:41:24 -0300
> I would rephrase 2. to: "a module should be fully self contained, not
> creating or using globals other than the base libraries"
Surely a module can use other modules it requires. If all required modules
behave well, then the module in question can do
local random=require"random"
and all is well. But if it require modules that only set a global variable,
then the module in question can only do
require"random"
local random=random
or use the global "random".
- References:
- Basic, no fuss, no magic, foolproof module pattern. [Was: require, module, globals and "magic"], Lorenzo Donati
- Re: Basic, no fuss, no magic, foolproof module pattern. [Was: require, module, globals and "magic"], Sean Conner
- Re: Basic, no fuss, no magic, foolproof module pattern. [Was: require, module, globals and "magic"], Lorenzo Donati
- Re: Basic, no fuss, no magic, foolproof module pattern. [Was: require, module, globals and "magic"], Roberto Ierusalimschy
- Re: Basic, no fuss, no magic, foolproof module pattern. [Was: require, module, globals and "magic"], Lorenzo Donati
- Re: Basic, no fuss, no magic, foolproof module pattern. [Was: require, module, globals and "magic"], Quae Quack
- Prev by Date:
Re: Basic, no fuss, no magic, foolproof module pattern. [Was: require, module, globals and "magic"]
- Next by Date:
Re: cross-compile alien
- Previous by thread:
Re: Basic, no fuss, no magic, foolproof module pattern. [Was: require, module, globals and "magic"]
- Next by thread:
[ANN] lpty 0.8-2
- Index(es):