[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: return value of require?
- From: Ben <thebassplayer@...>
- Date: Thu, 28 Feb 2008 15:51:59 -0800
On Thu, Feb 28, 2008 at 11:35 AM, Petite Abeille
<petite.abeille@gmail.com> wrote:
> That said, I personally tend to only deal with modules that return a
> table and don't pollute the global namespace recklessly. If they
> behave differently, they better need a good reason and/or add quiet a
> bit of value (e.g. Niklas' markdown.lua).
If one uses the `module` function, it puts an entry in the global
namespace anyway, correct? It's just if you do a `local math =
require "math"`, the `math` name resolves to the local entry first.
At least, that's my understanding. (Also, if this behavior didn't
happen, it would make it would make `require "foo"` useless.)
Ben