Support passing functions by value