> the following is still causing cognitive dissonance for me:
>
> (C52) lambda([x], if x>0 then true else false)(a);
>
> MACSYMA was unable to evaluate the predicate:...
>
> as opposed to
>
> lambda([x], x>0)(a) => (x>0)
Expressions in conditions like IF are evaluated using "IS". So in the
first case, implicitly you are asking for IS(a>0). But Maxima knows
nothing about the value of a (the error message should be better). In
Maxima 5.5, the correct error message is given:
MACSYMA was unable to evaluate the predicate:
a > 0
Some bug must have been introduced since then....
> if( x>0, x^2, 0 )
>
> and if x happens to be free, this expression simply remains
> unsimplified as a "symbolic if clause," to be possibly simplified
> later given assumptions on x.
I agree that symbolic if clauses would be very handy, but unfortunately
they don't currently exist in Maxima. Even symbolic boolean expressions
are very clumsy to manipulate currently. As it happens, I am working on
some of these issues.
> Say, do you happen to know how bad the symbolic eigenvectors will be?
Try eigenvalues(matrix([a,b,c],[d,e,f],[g,h,i])) to get a taste.
> ...I'd really like to curry it, so that I can pass around
> lpnorm(2) as a norm, without the receiver having a clue about the p
> parameter
Maxima has dynamic binding, like almost all of its contemporary Lisp
systems. So you can expect functional values to do what you want. You
can, however, simulate static binding by a careful use of SUBSTITUTE.
> Also, is there a function I can apply() to a list to get the sum?
> Like Plus@@List in math'a? That way, I could define something like:
Try apply("+",[a,b,c]) -- is that what you have in mind?
> I'm just suspicious about defining functions with all these index
> lookups on lisp lists.
Don't worry about it unless/until it actually becomes a problem. My
advice would be different if you were programming a core module of
Maxima itself, but you are not....
> PS: Suppose I wanted to set up a rewrite system for regular
> expressions. Would that be hard to do in maxima?
Take a look at the pattern matching system for rewrite rules. The
biggest problem you will have is probably guaranteeing termination....
-s