Curried Functions



Quoth Robert Dodier on Prickle-Prickle, Chaos 49, 3174:
> One way to get what (I think) you want is to use buildq.

I'm using curry, by the way, to study the growth of iterative
functions (f*_c = min{x >= 0: f^(x)(n) <= c});* by fixing f and c while
plotting x:

    curry(f, [args]) :=
    buildq([f, args], lambda([[x]], apply(f, append(args, x))));
    lg(x) := block([], log(x) / log(2))$
    iterated(f, c, x) := block([],
      if x <= c
      then 0
      else 1 + iterated(f, c, f(x)))$

    fs: [lambda([x], x - 1),
    lambda([x], lg(x)),
    lambda([x], x / 2),
    lambda([x], x / 2),
    lambda([x], sqrt(x)),
    lambda([x], sqrt(x)),
    lambda([x], x^(1/3)),
    lambda([x], x/lg(x))]$
    cs: [0, 1, 1, 2, 2, 1, 2, 2]$
    curries: map(lambda([f, c], curry(iterated, f, c)), fs, cs)$

    plot2d(curries, [x, 0, 2^6], [y, 0, 2^6], [gnuplot_term, X11])$


I'm not sure if some native Maxima facility would accomplish the same
thing.

-----------
* Cormen et al., Algorithms (2004), 60.