[Maxima] ev, subst, funmake, quote, apply ... argh!
robert.dodier at gmail.com
Wed Dec 26 10:51:03 CST 2007
On 12/25/07, dlakelan <dlakelan at street-artists.org> wrote:
ev(expr, nouns) verbifies all nouns in expr. ev(expr, foo) verbifies
> In other words, what's the "right" way?
Well, there are two general approaches, to treat the figure of merit as
an expression or as a function. You could give a function name or
lambda expression as the f.o.m. argument, and then call apply to
evaluate it for some specific arguments. Or you could construct an
expression (maybe a noun expression as shown above) and then
evaluate it in an environment with some variables bound to specific
Maxima is rather more comfortable with expressions than
functions, e.g. diff and integrate don't know what to do with lambda.
Stuff that I've written (lbfgs, lsquares) prefers expressions also.
I'd recommend you do the same. When Maxima in general is more
comfortable with functions, I'll be happy to revise anything that
only recognizes expressions.
More information about the Maxima