[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Function Pointers?
- From: "John S. Miley" <jmiley69@...>
- Date: Thu, 15 Nov 2001 23:25:05 -0600
How would I go about emulating function pointers in lua? Basically, what
I'm trying to accomplish is something like:
gCmdList = {
cmd1 = do_cmd1(),
cmd2 = do_cmd2(),
...
}
gObj1 = {
[properties]
lCmdList = {
cmd3 = do_cmd3(),
cmd4 = do_cmd4(),
...
}
}
gObj2 = {
[properties]
lCmdList = {
cmd5 = do_cmd5(),
cmd6 = do_cmd6(),
...
}
}
function do_cmd1()
block
end
function do_cmd2()
block
end
function gObj1:do_cmd3()
block
end
function gObj1:do_cmd4()
block
end
function gObj2:do_cmd5()
block
end
function gObj2:do_cmd6()
block
end
Thanks,
--jsm