Task

Pass a function     as an argument     to another function.



Related task

   First-class functions


 
% operator example
% 'ifelse' is passed a boolean and two procedures
/a 5 def
a 0 gt { (Hello!) } { (World?) } ifelse ==
 
% procedure example
% 'bar' is loaded onto the stack and passed to 'foo'
/foo { exec } def
/bar { (Hello, world!) } def
/bar load foo ==
 