Hi, first of all, great to have this new functionality and using it already in several places in my code.
I have a small (for me unsolvable) issue, and was hoping to use the function references/anonymous functions to find a solution.
What is the problem? I’m trying to convert a C++ macro to a Pascal function:
#define MEM(allocator, …) (someFunctionCall(), allocator(__VA_ARGS__))
it is called as follows:
MEM(allocString, “Hello world”);
MEM(allocCell, value);
MEM(allocFunction, codeObject);
The result of the MEM call will be a ‘Value’ type.
so, the macro allows to call different functions with different arguments.
The functions are defined as:
Value allocString(std::String string)
Value allocCell(Value value)
Value allocFunction(CodeObject codeObject)
Any idea how to convert this to Object Pascal?
Regards,
Jeroen