On 5/22/07, Albert.Reiner at ecs.steyr.com <Albert.Reiner at ecs.steyr.com> wrote:
> Consider the following:
>
> (%i13) gradef(Vb, R, Sb) $
> (%i14) diff(Vb);
> (%o14) Sb del(R)
> (%i15) diff(3*Vb);
> (%o15) 3 del(Vb)
>
> Instead of %o15 I would have expected 3*Sb*del(R).
> Is there some setting that makes diff behave in this way?
> Or should I file a bug report?
This behavior seems to be intentional, but certainly is confusing.
The available documentation for gradef (probably derived from
the union of old documentation and what could be puzzled out
by reading the code) seems to distinguish gradef(F(x), ...) from
gradef(F, x, ...) although the intended effect of this distinction
is obscure.
Certainly the two cases are treated differently by the code.
gradef (Va(R), Sa);
=> Va(R)
:lisp (symbol-plist '|$Va|)
=> (GRAD ((r) $Sa))
gradef (Vb, R, Sa);
=> Vb
:lisp (symbol-plist '|$Vb|)
=> (MPROPS (NIL DEPENDS ($r) $ATOMGRAD (($r . $Sa))))
gradefs;
=> [Va(R)]
An easy fix would be to cause the two forms of gradef to
assign the same properties. But I don't know what else
that would break.
My advice at this point is to file a bug report.
Thanks for your help,
Robert