As the topic states. I want to set the __call metamethod to a non-Anonymous function (is there a specific word for this? I have no idea!) AND I want that function to be yet to be defined in the code. So essentially I want to make the following to work.
local Data = {}
Data.__index = Data
Data.__call = Data.new
function Data.new()
local d = setmetatable({},Data)
return d
end
as opposed to using an anonymous function like this:
local Data = {}
Data.__index = Data
Data.__call = function()
local d = setmetatable({},Data)
return d
end
OR fully defining the function before hand like this:
local Data = {}
Data.__index = Data
function Data.new()
local d = setmetatable({},Data)
return d
end
Data.__call = Data.new