[Maxima] array arguments to function
robert.dodier at gmail.com
Tue Jan 29 09:41:28 CST 2008
On 1/28/08, Thomas Widlar <twidlar at yahoo.com> wrote:
> Can an array be passed to a function to work on, g(f)?
> Or must one pass the elements of arrays, g(f,f)?
Maxima doesn't handle array arguments consistently. Consider this:
g(x) := x : 1234;
Whether g changes the actual argument depends on the kind
of object that the actual argument is. If x is a list or a so-called
"fast" array, it is changed, but if x is an ordinary declared or
undeclared array, it is not.
This behavior is a bug. I don't know if g should consistently change
the actual argument or consistently not change it, but I am sure that
it should be consistent.
If you only want to read values in an array argument, I think
there is no problem. So maybe you can tell us what you are
trying to do.
More information about the Maxima