I normally call this function as following
Code: Select all
shape sut = getShape("bar");
invokeMethod(sut, "theFunction", ...);
Code: Select all
shape sut = getShape("bar");
sut.theFunction(...);
Code: Select all
shape sut = getShape("bar");
function_ptr sutTheFunction = sut.theFunction;
callFunction(sutTheFunction, ...);
Furthermore it seems to be, that it will find variable from the caller shape "foo".
My expectation is, that the function "theFunction" called via function_ptr uses the callee's context and not the caller's one.
Is this the intended calling semantic?
Best regards,
Frank