For example when I run this script:
someFunc = Function( {arg},
{},
Print( arg );
);
executor = Function( {fn, arg},
{},
fn( arg );
);
executor( someFunc, "this string" )I get an error, that seems to imply that I am calling someFunc when I am intending to pass a reference to it to executor.
I am able to pass a reference by defining the function in the invocation, e.g.
executor = Function( {fn, arg},
{},
Print(arg);
fn();
);
executor( Function({}, {}, Print("anonymous function"); ), "wut" );Outputs:
"wut"
"anonymous function"
Which accomplishes what I need, but it would be convenient to be able to pass functions using their variable names.