#2715 A problem with subscripted variables

None
open
nobody
None
5
2014-08-26
2014-04-02
Albrecht Mueller
No

In function definitions that use subscripted variables the names of the formal parameters seem to interfere with the names of the actual parameters.
Example:

foo(a,b):=a-b;
foo(b,a) evaluates to b-a, ok.

foobar(a,b):=a[1]-b[1];
foobar(x,[1]) evaluates to x[1]-1 which is ok, but

foobar(b,[1]) evaluates to zero and foobar(b,a) hangs.

More details in the attachement.

1 Attachments

Discussion