array functions



Uneducated attempt at an answer, maybe someone else will correct me:

print() prints its argument to stdout, hence you see "x" appear without
a C or D label.

It then returns the value of its last argument, which is why you see
[1,2] on the next output line.

Maybe you want
h1[k](x):=block(x);
or
h1[k](x):=x;

or something ... depending on what you're trying to accomplish.

Judah

> From: Dan Stanger <dan.stanger at ieee>
> 
> If I declare the array function h1[k](x):=block(print(x));
> and execute h1[1]([1,2]);
> it prints x, not [1,2] but the function returns [1,2].
> Shouldnt it print [1,2], not x?
> I see this behavior in maxima 5.5, and Macsyma 2.4.
> Can anyone think of a work around for this or explain this behavior?
> Dan Stanger