Thanks for your replies, I think your "subst" is exactly the same to newlisp "expand"
But picolisp curry function doesn't do that, it simply returns a lambda > with 1 parameter having the other one properly substituted with its value > thus making impossible to partially apply the returned function > > > I still think 'curry' is what you want. > > > As far as partial application, wasn't 'adder' an example of that? > > : (adder 3) > -> ((X) (+ X 3)) # partial application > : ((adder 3) 7) # used as function call > -> 10 > > yes, adder is an example of partial & total application but now we're talking about the result of using curry (here the adder function) which allows partial application. But when talking about the curry function itself the problem is the domain of function, in classical curry the domain are functions of n arguments (usually n>1) and the image are also functions with exactly 1 argument. Picolisp curry function does not follow the pattern, its domain is completely different and also its image. In other words, you call classical curry passing it a function argument but you call picolisp curry passing it several arguments to replace certain symbols inside expressions. It's a different kind of animal ;-) So you cannot apply picolisp curry to any general function, as you do in classical curry, you must create a picolisp curry call ad hoc to get a expected function returned With a classical curry function you can use (call 'f) to get a curryfied version of function f which takes only one argument and returns a function who takes only one argument and returns a function who... (supposing f has n arguments you have n levels on "indirection"), with picolisp curry you cannot call it like (call 'f) being f a general function (defined with de) The classical curry in picolisp is what Alex has defined a few emails before ;-) > I'm not sure that a structure such as > > ((X) '((Y) (+ X Y))) > > would be very useful in PL, though it could certainly be built with our > friends 'fill' or 'macro'. But I'm also not sure I understood your question > entirely. > > What that helpful at all? > > > Absolutely unuseful in picolisp, what I tried to express is the concept of functions returning functions characteristic of curryfied functions in picolisp syntax. The reason for this expression being completely useless in picolisp *I think* is the use of quote as an alias for lambda thus in practise protecting them from evaluation and binding -- Andrés *~ La mejor manera de librarse de la tentación es caer en ella**. ~ Oscar Wilde* ~