ev, subst, funmake, quote, apply ... argh!



Robert Dodier wrote:
> On 12/25/07, dlakelan <dlakelan at street-artists.org> wrote:
> 
>> minimize_sa('err(a,b,c,d),....)
> 
> ev(expr, nouns) verbifies all nouns in expr. ev(expr, foo) verbifies
> only foo.
> 
>> 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
> values.

I understand now that 'err(a,b,c,d) is not the same as '(err(a,b,c,d)) 
which was what was confusing me.  What exactly do I get when I type 
"'err(a,b,c)" ?? I don't know.

I think this area of maxima is ripe for confusion for users and perhaps 
we can devote some text to it in the manual??? It has bitten me for 
plot2d, find_root, and now my own minimizer.

So now my interface for my minimizer takes an expression, and evaluates 
it using "ev" rather than subst. I find ev in this specific context to 
make more sense. If someone cares to enlighten me on whether there is a 
better alternative to the use of "ev" within the minimizer code I'd be 
happy to hear it.