Task

Pass a function     as an argument     to another function.



Related task

   First-class functions


 
bundle Default {
  class HighOrder {
    function : Main(args : String[]) ~ Nil {
      f := GetSize(String) ~ Int;
      Print(f);
    }
 
    function : GetSize(s : String) ~ Int {
      return s->Size();
    }
 
    function : Print(func : (String)~Int) ~ Nil {
      func("Hello World!")->PrintLine();
    }
  }
}
 