Albert Reiner wrote:
> [Daniel Lakeland , Fri, 9 Dec 2005 14:34:47 -0800]:
>
>>I was disappointed when I tried to do something like this and found
>>that maxima uses dynamic scope instead of building a closure. I was
>>looking to write a function which takes data as an argument and
>>returns a function that does the interpolation, this is a standard
>>trick in LISP, but without closures it was not trivial.
>
> I find the following idiom to be easy to use and reliable:
>
> (%i1) make_inc(x) := buildq([x], lambda([y], x+y)) $
>
> (%i2) f : make_inc(2+3);
>
> (%o2) LAMBDA([y], 5 + y)
> (%i3) f(3);
>
> (%o3) 8
I don't get this, can someone explain how the above relates to creating
a function to interpolate from a set of data pairs?
Glenn
--
Glenn Ramsey 07 8627077
http://www.componic.co.nz