Newbie problems with plot2d



Not sure exactly what Robert had in mind here, but....

Maxima lists like [a,b,c] support both first(x) and x[1].
Maxima arrays do not support first(x), but do support x[1].  This is because
in general Maxima arrays do not have an unambiguous meaning for 'first'.  If
I assign x[cos(x)]:1 and x[sin(x)]:-1, what would first(x) be?

As for defining things, as you say, f(x):= is for function definitions.
 f[x]:= is for defining memoizing functions, where the body is not
re-evaluated every time the function is called -- nothing really to do with
matrices.  Thus:

a:0$
f(x) := (a: a + x)$

f(2) => 2
f(2) => 4
f(3) => 7

f[x] := (a: a + x)$

f[2] => 9
f[2] => 9     <<<<<<<<<<<< remembers calculated value
f[3] => 12
f[3] => 12   <<<<<<<<<<<<



On Fri, Jun 17, 2011 at 17:02, carolus <worwor at bellsouth.net> wrote:

> On 6/17/2011 11:15 AM, Robert Dodier wrote:
>
>  (Yes, it is unclear and confusing to try to distinguish
>> between programming functions and symbolic functions.
>> Sorry about that.)
>>
>>  What is the difference? I've noticed "f(x) :=" for function definition
> and "f[x] :=" for initializing matrices.  Is that what you are talking
> about?
>
>
> ______________________________**_________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/**mailman/listinfo/maxima<http://www.math.utexas.edu/mailman/listinfo/maxima>;
>