Task

Pass a function     as an argument     to another function.



Related task

   First-class functions


 
q)sayHi:{-1"Hello ",x;}
q)callFuncWithParam:{x["Peter"]}
q)callFuncWithParam sayHi
Hello Peter
q)callFuncWithParam[sayHi]
Hello Peter