case syntax



 

> -----Original Message-----
> From: maxima-bounces at math.utexas.edu 
> [mailto:maxima-bounces at math.utexas.edu] On Behalf Of Daniel Lakeland
> ....
> > 
> > > Else  case(inpart(expr,0),
> > >            ["+", yyy],
> > >            ["*", zzz],
> > >            [otherwise, ...])
> > 
> > I'm not opposed to having a case statement, but I don't like
> > constructs that don't distinguish the different parts.
> > I don't think a list of 2-element expressions has anything to
> > recommend it, except it would be easy to implement.

Mostly it is roughly the same as lisp, which uses syntax like this..

 (case  xxx
    (first_alternative  first_action)
    ((list of possible alternatives)  action1 action2 ....)
    (otherwise  the_rest of the case actions...)

)

Using : is, in my view, confusing since that has another use.  But then some
people like the C language which uses * for about 5 different concepts.

RJF