>
>
>Foo(w):= Block([],
>
> array(w,100),
> is this the same w? what does w[10]:300 really do? How about
>return(w), does it return w's value or its array property?
>
>
>
I guess in any algol like language array(w,100) would be a local
variable declaration which would shield
the parameter w.... In maxima it gives the symbol w an array property,
which is global since as you say
Foo(w):=... only puts the *value* of w on the stack.....That's why I
assume return(w) only returns the value
of w but I have not checked it.
Also in an algol like language (if you omit the declaration
array(w,100)), w[10]:300 would change the tenth element
of the array passed in w (array elements are passed by reference as an
array is really a pointer).
In maxima this happens for lists (as lists are values) but not for
arrays. I find this a little bit depressing as in my
mind arrays and lists are both sequence types and they should be treated
in the same way as much as possible.
If you set use_fast_arrays:true then arrays are saved in the value cell
(as lisp arrays), but then such arrays
have limitations compared to standard maxima arrays (this is probably
just an implementation issue).
I assume the decision to have a separate function cell in Common Lisp
was for efficiency reasons. I don't
seem any reason why that has been carried through to the maxima level
(as maxima functions are not
lisp functions anyway).
Michel