Question: Why is eval needed to call procedure in package when its name is first assigned to variable?

This works

restart;
ode := diff(y(x),x)=a0+a1*y(x)+a2*y(x)^2+a3*y(x)^3;
DEtools:-abelsol(ode);

But this does not

restart;
ode := diff(y(x),x)=a0+a1*y(x)+a2*y(x)^2+a3*y(x)^3;
name_of_solver:=abelsol;
DEtools:-name_of_solver(ode);

Then I found this made it work

eval(DEtools:-name_of_solver)(ode);

So I am guessing what happens is this: doing DEtools:-name_of_solver Maple first searched for a proc called name_of_solver inside DEtools package, and found none. So it does not work.

But adding eval first, then name_of_solver is evaluated and replaced by abelsol and after that the call is made, and it then finds this proc inside the DEtools package.

But my question is, why is eval needed here?

Is it not automatically happens that a variable is replaced by its value? So I expected DEtools:-name_of_solver to automatically become DEtools:-abelsol and only then the call is made.

Why the rule of evaluation is different in this case?

Please Wait...