Comment on Exercise 93: 6

The Maple function evaln provides a way of evaluating an expression as a name. (See its help page.)

The following sequence contains two ways of “unassigning” the variables v1, v2, v3 in a loop.

First, bind the variables:

for j from 1 to 3 do
 v || j := j + 2;
od;
print(v1, v2, v3);

This demonstrates evaln without unbinding the variables:

for j from 1 to 3 do
 evaln(v || j);
od;
print(v1, v2, v3);

Now unbind the variables:

for j from 1 to 3 do
v || j := evaln(v || j);
od;
print(v1, v2, v3);

Bind the variables as before, and then unbind them a different way.

for j from 1 to 3 do
 v || j := j + 2;
od;
print(v1, v2, v3);
unassign(evaln(v || (1..3)));
print(v1, v2, v3);