[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Is there any convenient function like module(...) for returning a function from a module?
- From: steve donovan <steve.j.donovan@...>
- Date: Thu, 6 Mar 2014 10:20:20 +0200
On Thu, Mar 6, 2014 at 10:14 AM, Journeyer J. Joh
<oosaprogrammer@gmail.com> wrote:
> I want my module return a function.
> For my particular case, Is there any convenient function like module(...)?
Just something like this:
-- ftest.lua
return function(a)
return {value = a}
end
then require 'ftest' will give you a function, which you can call.