[Maxima] strange behaviour in function definition

Mario Rodriguez biomates at telefonica.net
Fri Jun 27 12:26:49 CDT 2008


> Maxima's parser is greedy --- foobar is parsed into "foo"(bar) when "foo"
> is a prefix operator. (Try :lisp $% to see what gradient(p):= ... was
> parsed into.) Backslash defeats recognition of operators ---
> try \gradient instead. (Likewise a\+b is a symbol, not an expression.)

I understand now the origin of the problem and why

reverselist(x):=reverse(x);

doesn't exhibit the same behaviour.


> I don't see how it could have worked before; the parser has always
> been greedy. I tried the above example w/ some old versions
> (oldest = 5.9.2) and got the same behavior. Maybe different Lisps
> behave differently; if so, that's a bug, the Maxima parser should be
> greedy in all Lisps.
> 

Yes, now that I look closer, I see that the older function was named 
'mygradient', not 'gradient'.

Thanks for the clarifications.

-- 
Mario Rodriguez Riotorto
http://www.telefonica.net/web2/biomates


More information about the Maxima mailing list