|
Hi Peter Melnichenko and Dirk Laurie,I tested underLua 5.1.5 Copyright (C) 1994-2012 Lua.org, PUC-RioAnd now things seem confusing...What I imported by require is from the url below.http://lua-users.org/wiki/TemplatePatternThe account.lua.And I have no idea then...RegardsJourneyer----------------------------------------
Journeyer J. Joh
o o s a p r o g r a m m e r
a t
g m a i l d o t c o m
----------------------------------------2014-03-06 16:46 GMT+09:00 Peter Melnichenko <petjamelnik@yandex.ru>:
> local aaa = require "account"Generally this must work, meaning that aaa and bbb must be different instances of the module. It may not work in your particular case if the module requires submodules, they must all be reloaded.
> print(aaa)
> package.loaded["account"] = nil
> local bbb = require "account"
> print(bbb)
For example, consider luasocket:
```lua
-- socket.lua
local socket = require("socket.core")
local _M = socket
...
return _M
```
Here the table of the module actually comes from the "socket.core" module, so if you want to get a completely new instance it should be reloaded, too(and other socket.* modules).