[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Modules that are functions
- From: Dirk Laurie <dirk.laurie@...>
- Date: Fri, 22 Nov 2013 07:01:41 +0200
2013/11/22 Craig Barnes <email@example.com>:
> On 22 November 2013 03:43, Andrew Starks <firstname.lastname@example.org> wrote:
>> If you're redistributing the module, a table is expect, which feels more sorted out.
> If a module only provides a single, top-level function, feeling
> "sorted out" isn't a particularly compelling reason to avoid just
> returning it as-is.
Lua standalone is my favourite interactive language, so I like modules
something informative when you require them. I like them callable too: function,
callable table or userdata, it does not matter.
> mymod = require "mymod" -- prints a welcome message
If for non-interactive use you want to suppress the message, that
can be done by providing an option, e.g.
> mymod = require "mymod" "silently"