lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Thu, Jul 31, 2014 at 2:23 AM, Dirk Laurie <dirk.laurie@gmail.com> wrote:
> What I have done in some of my modules is to make them
> return two values. Then `require "mymod"` only accesses the
> public part, but `mymod, private = dofile"mymod.lua"` also
> returns a table containing some local functions, cached
> while they were visible.


Wow, that's very elegant! I shall be stealing this trick. =)

-- 
NI!

() - www.asciiribbon.org
/\ - ascii ribbon campaign against html e-mail and proprietary attachments