Calls a function for each node of the path.
a Path
the function to call with each node
user data to pass to the function