Task

Pass a function     as an argument     to another function.



Related task

   First-class functions


 procedure main()
   local lst
   lst := [10, 20, 30, 40]
   myfun(callback, lst)
end
 
procedure myfun(fun, lst)
   every fun(!lst)
end
 
procedure callback(arg)
   write("->", arg)
end