Jump to content

Apply a callback to an array: Difference between revisions

→‎{{header|Icon}}: fixed to pass procedure name for application
(→‎{{header|Ruby}}: ++ sather)
(→‎{{header|Icon}}: fixed to pass procedure name for application)
Line 529:
local lst
lst := [10, 20, 30, 40]
every callback(write,!lst)
end
 
procedure callback(p,arg)
writereturn p(" -> ", arg)
end</lang>
 
==={{header|Unicon}}===
This Icon solution works in Unicon. A solution that uses Unicon extensions has not been provided.
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.