rather than storing b,c and d, why not just put them in the function manually?
["a"] = {
f = foo(false, 1, "e"),
},
unless you’re looking for a method in which to store the values in the table as well, perhaps:
local tbl = { -- first, store the values
["a"] = {
b = false,
c = 1,
d = "e",
},
}
tbl.a["f"] = foo(tbl.a.b, tbl.a.c, tbl.a.d) -- insert whatever foo returns at "f"
This of course assumes a is stored within another table, index it as you need. Essentially what we’re doing is inserting the values b, c and d first, then calling foo() with the values of tbl.a as parameters, and inserting whatever foo returns into tbl.a with index "f"
That’s not really what i asked…
What i want is that i DON’T have to individually give parameters. This makes my scripts cleaner and if the function isn’t the same on different tables, this method would suck. What i essentially mean is this:
["a"] = {
b = false,
c = 1,
d = "e",
f = function(parent) --Parent is the table itself
--Do something
end,
},
WITHOUT having to manually input the table itself.
Forgive me for misunderstanding. I showed you some methods I believed would be applicable in your case.
I’m confused whether you’re intending to call the function from the table, or to store it there and call it later on. Regardless, as far as my knowledge goes, I’m not sure of any other methods to do what you’ve asked.