Little Test Explanation In the first set circle_area is assigned the object The variable r is also fully evaluated in the circle_area
assignment of the second set, but this time r evaluates to r, not 2 (its
pointer points nowhere). Thus, cirlce_area is assigned to the object The first set. > r := 2;
> circle_area := Pi*r^2;
> circle_area;
> r := 8;
> circle_area;
At this point a snippet from memory looks like:
The second set. > r := 'r';
> circle_area := Pi*r^2;
> r := 2;
> circle_area;
> r := 8;
> circle_area;
And at this point a snippet of memory looks like:
As an aside, note that neither of the expressions pointed to in this picture have pointers associated with them, even though they are both objects. An object is anything that Maple can store in memory, but not all objects can be variables. For example, an integer cannot be a variable, and neither can any expression containing a multiplication operation. Another way to think of an object that can be a variable is that such objects can be placed on the left side of an assignment operator, :=. If you try this with objects that cannot act as variables, Maple will give you an error message. Try it. Tutorial Index Maple Index How to... Problem Set Index
|