[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: modules, require, magic
- From: Josh Simmons <simmons.44@...>
- Date: Tue, 18 Oct 2011 18:28:28 +1100
On Tue, Oct 18, 2011 at 6:20 PM, Sean Conner <sean@conman.org> wrote:
>
> "But module() and require() could keep a private table with references to
> each module and not dump them into the global space," you say. Okay, but
> you *still* need a global namespace, because DarkGod has *his* DNS module
> (named dns) and I have *my* DNS module (which would also be named "dns"), so
> which one is returned when you require("dns")? (assuming that I have
> modules I wrote using my DNS module, and some other modules I want to use
> might be using DarkGod's DNS module)
>
Require already does this, and you need to separate them at the
filesystem level irregardless of what scope they're imported into.
local dns = require 'crazy.weird.dns'
local dns2 = require 'somebody.elses.dns'
None of this has anything to do with global scope or module.
- References:
- modules, require, magic, Eduardo Ochs
- Re: modules, require, magic, Javier Guerra Giraldez
- Re: modules, require, magic, Petite Abeille
- Re: modules, require, magic, Sam Roberts
- Re: modules, require, magic, David Manura
- Re: modules, require, magic, Mark Hamburg
- Re: modules, require, magic, Sean Conner