I have a function named myFunction which takes as inputs a list and a function and it applies the function on every element of the list. Example:
list = {1,2,3}
def square(int x):
return x*x;
myFunction(list , square) should return {1 ,4, 9}
Now here is the catch, the user can give any function as the input. I know that the functions can be wrapped in the interface and passed as arguments. But in my case, i wouldn't know the name of the function to begin with. Is there any way to deal with this?