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



In my attempt to create a simulated annealing minimizer, I'm baffled by
the following problem.

Suppose I define a function which computes a figure of merit (rather
than an expression, this is more of a computational function). An
example, I want to minimize the max absolute error of my polynomial 
across a table of x,y values.

xypairs := [[1,1],[2,3],[3,7],[5,4],[8,9]];

err(a,b,c,d) := lmin(map(lambda([x,y],float(abs(a+b*x+c*x^2 - y))),
xypairs)))

now I want to do something like this...

minimize_sa(err(a,b,c,d) [a,b,c,d],[1,2,3,4]...)

now for a regular function, err(a,b,c,d) will be evaluated BEFORE
minimize_sa is called and therefore fail because err can't handle
symbolic values in any useful way... so my inclination is to quote it...

minimize_sa('err(a,b,c,d),....)

however, when minimize_sa applies "subst" to this quoted expression it
seems to evaluate to something like err(1,2,3,4) rather than actually
calling the function err with those values. Even "ev" causes this 
behavior as far as I can tell. in other words, i think this is a "noun" 
form yes??

If I pass "funmake(err,[a,b,c,d])" to the minimizer it seems to work, 
when I use "ev" within the minimizer code. but how should I handle this? 
In other words, what's the "right" way?