lua-users home
lua-l archive

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


Is this what you're trying to do?

local meta
meta = {

	__index = function(t, k)
		print("__index", t, k)
		if(not rawget(t, k)) then
			rawset(t, k, setmetatable({}, meta))
		end
		return t[k]
	end,
	
	__newindex = function(t, k, v)
		print("__newindex", t, k, v)
		rawset(t, k, v)
	end
}


-- config.network.server.url
local config = setmetatable({}, meta)
config.network.server.url = "http://www.lua.org";