On 2/20/08, David Ronis <ronis at ronispc.chem.mcgill.ca> wrote:
> f(l,m):=A[l,m]+B[l,m]+A[l+1,m];
> ev(f(l,m), A[l,m]=0);
>
> A[l,m] still appears in the result.
>
> However,
>
> f(l,m);
> ev(%, A[l,m]=0 );
>
> works as expected. What am I missing?
Well, the mechanism for saving and restoring local variables
handles only simple variables (not subscripted variables).
ev substitutes for subscripted variables instead.
But substitution doesn't have quite the same effect, as you
have observed. See $EV in src/mlisp.lisp.
This is a bug; I guess it could be fixed by making MBIND
and friends happy with subscripted variables. Dunno if that
would cause trouble elsewhere.
If you have time, perhaps you can submit a bug report about this.
best
Robert Dodier