[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Modules that are functions
- From: Craig Barnes <craigbarnes85@...>
- Date: Thu, 21 Nov 2013 22:41:20 +0000
On 21 November 2013 22:32, Kevin Martin <email@example.com> wrote:
> 1) I'll never be able to remember which modules return tables, and which return a function
But that's not the kind of thing that'll go unnoticed for very long.
> 2) I can guarantee that at some point in the future, that module which currently only has one function will need another, and the rewrite will be horrific if not returning a table.
How so? It seems like a case of just changing:
local fn = require "modname"
local t = require "modname"
local fn = t.fn