bump85.gif (832 bytes)

Little Test Explanation

Kinematics 1
Maple Think
Tutorial Index
Maple Index
How to...
Problem Set Index

In the first set circle_area is assigned the object 4 Pi, because before the assignment occurs the variable r on the right side of := is fully evaluated (its pointer is followed), and the found value, 2, is substituted into the expression.  This evaluated expression is then assigned to circle_area

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 Pi r^2.  Every time Maple encounters an expression containing variables, it evaluates those variables unless told otherwise.  As a result, in the second set, every time the value of r changes, circle_area, assigned the object Pi r^2, evaluates to a different value.  Take a look at the pictures following each set below.

The first set.

> r := 2;

r:=2

> circle_area := Pi*r^2;

circle_area:=4 Pi

> circle_area;

4 Pi

> r := 8;

r:=8

> circle_area;

4 Pi

At this point a snippet from memory looks like:

circle1.gif (3809 bytes)

The second set.

> r := 'r';

r:=r

> circle_area := Pi*r^2;

circle_area:=Pi r^2

> r := 2;

r:=2

> circle_area;

4 Pi

> r := 8;

r:=8

> circle_area;

64 Pi

And at this point a snippet of memory looks like:

circle2.gif (3874 bytes)

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.

Top

horzn_ln.gif (2407 bytes)

Maple Think         Kinematics 1

Tutorial Index        Maple Index         How to...        Problem Set Index


Please send me any polite comments, suggestions, or corrections.