Smart pascal source code
function this: variant; external 'this' property;
// var this external "this" : THandle; --> external class
procedure procedureToCall(unknown: variant);
begin
{ add a new property just for fun }
unknown.NewValue := "Look, no hand";
{ call back into the unknow object }
unknown.Callback(unknown);
end;
procedure DONTCALLME;
begin
procedureToCall(
CLASS
someProperty: Integer = 12;
Callback := procedure()
begin
{ dump object to console }
WriteLn(this) // {"someProperty":12,"NewValue":"Look, no hand"}
end;
END);
end;
function DONTCALLME() {
/// anonymous TClassSymbol
procedureToCall({
"Callback" : function () {
WriteLn(this);
}
,"someProperty" : 12
});
};
function procedureToCall(unknown) {
unknown.NewValue = "Look, no hand";
unknown.Callback(unknown);
};