Bit confused by all this; so here's what I am attempting to do! Have a def thus:
block_basic_DEF =
{
image = "button.png",
name = "basic block",
obj_table = this_obj_table.common_objects_table,
startup = function() init(), <----- This is the problem
}
In another file I access as one would expect with:
function spawn(params)
local obj = display.newImage(params.image)
-- etc.
In that block_basic_DEF
I wish to pass the address of the init()
function such that in my spawn I can do something like:
params.startup()
--i.e. actually call the original init function
params.startup()
actually treats the value referenced byparams
as a table and indexes it with the stringstartup
to get its value (dot operator). Then it invokes the value as a function (parentheses operator). That function then invokes the value referenced byinit
as a function.