Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,20 @@
|
|||
delegate callback( i int ) returns( int ) end
|
||||
|
||||
program ApplyCallbackToArray
|
||||
function main()
|
||||
values int[] = [ 1, 2, 3, 4, 5 ];
|
||||
|
||||
func callback = square;
|
||||
for ( i int to values.getSize() )
|
||||
values[ i ] = func( values[ i ] );
|
||||
end
|
||||
|
||||
for ( i int to values.getSize() )
|
||||
SysLib.writeStdout( values[ i ] );
|
||||
end
|
||||
end
|
||||
|
||||
function square( i int ) returns( int )
|
||||
return( i * i );
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue