Hello,
I'm attempting to create a system where a table containing a function executes that function upon encountering it.
Given a function:
function doAThing(arg1, arg2)
--dostuff
end
And given a table:
story={
[1]="Once upon a time..."
,[2]="Long ago..."
,[3]="So long ago that everyone forgot..."
,[4]=doAThing(3,"foobar")
}
And finally, given a way to iterate through the table:
for i,v in pairs(story) do
if type(v) == "string" then
print(v)
elseif type(v) == "function" then
do function?
end
end
How would I execute the function the iterator has found?
Thanks!