2024-10-04 10:29:55 +02:00
|
|
|
function test( c )
|
|
|
|
|
return ( "works" + c );
|
2018-02-04 16:08:03 +01:00
|
|
|
endfunction
|
|
|
|
|
|
2024-10-04 10:29:55 +02:00
|
|
|
function copy( c )
|
|
|
|
|
print( c.call( "copy" ) );
|
2018-02-04 16:08:03 +01:00
|
|
|
endfunction
|
|
|
|
|
|
|
|
|
|
program t()
|
2024-10-04 10:29:55 +02:00
|
|
|
var f := @test;
|
|
|
|
|
var res := f.call( "direct" );
|
|
|
|
|
copy( f );
|
|
|
|
|
print( "res " + res );
|
|
|
|
|
print( @test );
|
|
|
|
|
copy( @test );
|
2018-02-04 16:08:03 +01:00
|
|
|
|
2024-10-04 10:29:55 +02:00
|
|
|
if ( f )
|
|
|
|
|
print( "error" );
|
|
|
|
|
else
|
|
|
|
|
print( "funcref is always false" );
|
|
|
|
|
endif
|
2018-02-04 16:08:03 +01:00
|
|
|
|
2024-10-04 10:29:55 +02:00
|
|
|
// should be packet to uninit
|
|
|
|
|
print( pack( f ) );
|
|
|
|
|
print( unpack( pack( f ) ) );
|
2018-02-04 16:08:03 +01:00
|
|
|
endprogram
|