[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: A guide to building Lua modules
- From: Dirk Laurie <dirk.laurie@...>
- Date: Mon, 14 Apr 2014 17:55:13 +0200
2014-04-14 17:29 GMT+02:00 Coroutines <coroutines@gmail.com>:
> If a module returns false or nil, I believe it will be loaded from the
> file on every require().
Not quite. The go/nogo test is whether there is an entry for the module
in package.loaded.
$ lua
Lua 5.2.3 Copyright (C) 1994-2013 Lua.org, PUC-Rio
> package.loaded.lpeg = "bazinga"
> lpeg = require"lpeg"
> =lpeg
bazinga