I would love to see the semantics of that formally defined.
So piece acts like a reference in a global variable.
So if
part(a,1)+part(b,2)
is executed, what piece points to is implementation dependent,
or is the semantics of the above statement defined somewhere
regarding evaluation order?
Stavros Macrakis wrote:
> > Is there a part function that can map a function on to the
> > selected part? For example: given (z+2)/(z+1)^2
> > u:expand(part(d1,2))
> > substpart(u,d1,2)
>
> 'piece' is set to the selected part in all the part functions, and the
> first arg of substpart is evaluated *after* the piece has been set, so
> this works:
>
> substpart(expand(piece),d1,2)
>
> Piece is documented under substinpart and piece, but not in substpart.
> In fact, there are examples for substpart under substinpart, so it looks
> as though the doc was messed up when it was reorganized at some point.
>
> -s
>
> Example:
>
> (C1) ex:x^3-a-1;
> 3
> (D1) x - a - 1
>
> (C2) substpart(factor(piece),ex,[1,3]);
>
> 2
> (D2) (x - 1) (x + x + 1) - a
>
> _______________________________________________
> Maxima mailing list
> Maxima@www.math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima