| Kevin Ryde on Thu, 11 Dec 2014 08:40:35 +0100 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
| Re: memoize.gp |
Bill Allombert <Bill.Allombert@math.u-bordeaux.fr> writes:
>
> ? component(f,5)
> %2 = ["x","x^2+1"]
Looks promising. Is there a list of the arg names without default value
expressions? Eg. just "x,y,z" from something like
foo(x,y=2*x+1,z=5) = fibonacci(x)*fibonacci(y)*fibonacci(z);
component(foo,5)
=>
["x,y=2*x+1,z=5", "fibonacci(x)*fibonacci(y)*fibonacci(z)"]
A list of arg names and expressions individually rather than in a single
string could also suit.
(I have to confess to hardly using default args, and I don't think I've
memoized any, but the idea was for convenience and generality. :-)