I find the rules for the evaluation of local variables in procedures confusing and dangerous. Here is the example on page 204 of the introductory programming guide for Maple 11. f:=proc() local x,y,z; x:=y^2; y:=z; z:=3; x; # eval(x); # this gives f() = 9 end proc; f(); f() gives the answer y^2. To get the answer 9 you have to use eval(x). The guide says this is done for efficiency. I would strongly disagree and say that the default behavior should be considered a bug not a feature because the returned result is not obvious. Is there any way to force Maple to fully evaluate local variables by default without having to put in eval statements all the time? Thanks. John

Please Wait...