polserver/testsuite/escript/func/funcref01.src

27 lines
369 B
Text
Raw Permalink Normal View History

function test(c)
return("works"+c);
endfunction
function copy(c)
print(c.call("copy"));
endfunction
program t()
2018-02-05 19:21:27 +01:00
var f:=@test;
var res:=f.call("direct");
copy(f);
print("res "+res);
print(@test);
copy(@test);
if (f)
print("error");
else
print("funcref is always false");
endif
// should be packet to uninit
print(pack(f));
print(unpack(pack(f)));
endprogram