polserver/testsuite/escript/func/funcref01.src

27 lines
442 B
Text
Raw Permalink Normal View History

function test( c )
return ( "works" + c );
endfunction
function copy( c )
print( c.call( "copy" ) );
endfunction
program t()
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