[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Why not Just PHP-stupid include?
- From: Tony Finch <dot@...>
- Date: Tue, 18 Oct 2011 17:18:27 +0100
Axel Kittenberger <email@example.com> wrote:
> I dunno, why can node.js do it right on modules so simply,
There's not much difference between the require functions in Lua and Node.
The search paths work differently.
Node has a magic "exports" object whereas Lua lets the programmer choose
the name of the exported table which must be explicitly returned.
Node and Lua-5.1 suppress recursive requires. Lua-5.2 does not.
The differences in scoping seem to have more to do with differences
f.anthony.n.finch <firstname.lastname@example.org> http://dotat.at/
Sole: Northwesterly 4 or 5, occasionally 6 in east. Rough or very rough. Rain
then showers. Good occasionally moderate.