higher order functions in pascal???