[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: Roberto Ierusalimschy <roberto@...>
- Date: Wed, 18 Aug 2010 17:00:11 -0300
> On a related note, may I assume from what you said that now the
> standard contract for a module can be (incompletely) summarized as
> in the following lines?
>
> 1. when loaded and called, a module's chunk should return a table
> containing its "exported" symbols
> 2. a module should not create any global
> 3. ? any more items in the contract?
Roughly it is only rule 1. (We should not say what it should not do: a
module should not create any global; it also should not erase your hard
disk; it should not send emails to your friends; etc.)
But remember that this is a standard contract; modules are
free to use different contracts if needed (see related message).
> (BTW should this contract be the same for both Lua and C modules?)
Yes.
-- Roberto
- 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
- Prev by Date:
Re: Basic, no fuss, no magic, foolproof module pattern. [Was: require, module, globals and "magic"]
- Next by Date:
Re: Basic, no fuss, no magic, foolproof module pattern. [Was: require, module, globals and "magic"]
- Previous by thread:
Re: Basic, no fuss, no magic, foolproof module pattern. [Was: require, module, globals and "magic"]
- Next by thread:
Re: Basic, no fuss, no magic, foolproof module pattern. [Was: require, module, globals and "magic"]
- Index(es):