I have this Lua code to initialize a table:
table = {
a = 1;
b = myfunc();
c = function () <some code> end;
}
After this table.c has type function and I have to use table.c()
in a print statement with the .. operator to get the result. But I would like to just use table.c
instead.
Is there a way that I can get the return value of the function assigned to table.c so the type is not function without having to define a function outside of the table?