I know that when you write a lambda you have to capture the outside variables to make them available inside the lambda. But what about functions? Do functions have access only to
GLOBAL variables? I have doubts regarding this because of how the following code works.
std::cout << "Printed" << std::endl;
var t := Test();
func(); // this raises an error "Can not find object t"
Everything is fine so far (at least works as expected), but when I try to call
func from C++, it works without errors:
auto func = engine.eval<std::function<void()>>("func");
Is it a bug or intended behavior?