RosettaCodeData/Task/Apply-a-callback-to-an-array/FutureBasic/apply-a-callback-to-an-arra...

16 lines
344 B
Plaintext

include "NSLog.incl"
void local fn Callback( array as CFArrayRef, obj as CFTypeRef )
long value = intVal(obj)
NSLog( @"Square root of %ld = %f", value, sqr(value) )
end fn
void local fn DoIt
CFArrayRef array = @[@1, @2, @3, @4, @5, @6, @7, @8, @9, @10]
ArrayEnumerateObjects( array, @fn Callback, NULL )
end fn
fn DoIt
HandleEvents