lua-users home
lua-l archive

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


On Thu, Mar 6, 2014 at 8:58 AM, Journeyer J. Joh
<oosaprogrammer@gmail.com> > There is no way to make two instances of
a module.
>
> Am I right?

Completely right.  By design, modules are loaded exactly once, and cached.

What do you want to do?

You can create a module which returns a function (doesn't always have
to be a table!) which you call to create a new specialized 'instance'.

(classes are a subset of this idea)

steve d.