From: Daniel J S. <dan...@ie...> - 2006-07-07 07:35:04
|
(from sourceforge) When bivariat.dem is run from all.dem there is a failure. The reason is a previous definition of f() from stat.inc which does not have the same number of inputs as f() used in the definitions in bivariat.dem. At the point of calling bivariat.dem f() is defined as: f(x,d1,d2)=d1<=0||!isint(d1)||d2<=0||!isint(d2)?1/0: Binv(0.5*d1,0.5*d2)*(real(d1)/d2)**(0.5*d1)*x**(0.5*d1-1.0)/(1.0+(real(d1)/d2)*x)**(0.5*(d1+d2)) Then running bivariat.dem: gnuplot> int1a(x,d) = (x<=d*.1) ? 0 : (int1a(x-d,d)+(f(x-d)+4*f(x-d*.5)+f(x))*d/6.) ^ "bivariat.dem", line 24: requires 3 variables It is later that bivariat.dem redefines f() to be a two variable function. So, the question is, is the above error message the desired behavior? Or should gnuplot wait until evaluation time *only* to complain? If the list decides it is only at evaluation time, not also parse time, that number of variables should be checked then the attached patch will fix the problem. I've verified that gnuplot still catches inconsistent input arguments if the problem exists. It looks as follows: gnuplot> load 'bivariat.dem "bivariat.dem", line 42: function f requires 3 variables Dan |