value()
method does break up the object into its components, so
($f1,$f2,$f3) = Compute("<t,t^2,sin(t)>")->value;will make
$f1
be t
, $f2
would be t^2
, and $f3
would be sin(t)
.
This is useful when you are using objects you have created itself, but it would not be wise to use this on student answers, since there is no guarantee that they will have entered a vector in this way (and not as a vector expression). I suppose one could test the class of the top-level node of the expression tree, but it is not clear what you would do if it weren't a Vector.
Davide