Determining the variables underlying a function

Jun 20, 2014 at 12:57 PM
I am wondering if there is any mechanism to determine the variables that a function depends on given a user supplied function? To be clear, suppose I define
Variable x = new Variable("x");
Variable y = new Variable("y");
Variable z = new Variable("z");
Function f = x * x + y;
Function g  = y * y + z;
Then is there any way of finding out that f depends on x and y whereas g depends on y and z?

Jun 27, 2014 at 9:32 AM
It's unfortunately not possible. The library is currently designed so that Function objects are as minimal as possible to make it easy to added new functions. I have been considering to add a Dependencies property or something, though, and will maybe do it in the future. I was considering to do some sorting before function evaluation using such a property, but I couldn't make it efficient. So I decided against adding this property.