I don't think this
http://rosettacode.org/wiki/Apply_a_callback_to_an_array#Icon
procedure main()
local lst
lst := [10, 20, 30, 40]
every callback(!lst)
end
procedure callback(arg)
write("->", arg)
end
satisfies the spirit of the question - ie it doesn't illustrate how to pass
around and apply a callback function
I believe we need
procedure main()
local lst
lst := [10, 20, 30, 40]
applier(printer, lst)
end
procedure printer(n)
write("-> ", n)
end
procedure applier(callback, container)
every callback(!container)
end
The problem seems to be showing how an arbitrary callback can be applied to
all the members of a generic container - in this instance a simple array or
list. Looking around at the other samples, I see that many of the combatants
have also misunderstood the issue
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Unicon-group mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/unicon-group