Extending maxima language



I'd like the "if" statement amended to include "elseif"; for example:

if a=b then return(a) elseif a<b return(b-a) else return(b);

Currently there's no way of doing this without placing a second "if"
statement inside a "block" which is clumsy.  If there was no restriction on
the number of elseif's then this would obviate the need for a case
statement, and also fit nicely into Maxima's current syntax.

-Alasdair


On 1/8/07, Andrej Vodopivec <andrej.vodopivec at gmail.com> wrote:
>
> Since people are discussing a new case statement for maxima I propose
> we add some more stuff at the same time.
>
> Currently I can think of three things which I would like to have in
> maxima. I think I would like to have 2) and 3) even more that 1).
>
> 1) cond statement (with whatever syntax)
>
> 2) assignments to lists:
> something like [a,b,c] == [1,2,3] would be equivalent to a:1, b:2,
> c:3. This could be done by extending : to work in this case or adding
> a new operator == or similar.
>
> 3) unwind_protect:
> I think Barton had an implementation which he posted to this list.
>
> Andrej
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>