[Python-Dev] PEP 309, function currying

Greg Ewing greg at cosc.canterbury.ac.nz
Sun Feb 22 19:50:11 EST 2004


Andrew Koenig <ark-mlist at att.net> wrote:

> I'm with Dave on this one:  If you have a function f that takes two
> arguments, then currying f should yield a function with one argument that
> returns a function that takes one argument.
 
and then he wrote:

> > I'll quote from the abstract:
> >    Function currying is the process of partially, or incrementally,
> > supplying arguments to a function.  Curried functions are delayed
> > functions expecting the remainder of the arguments to be supplied.
> > Once all the arguments are supplied, the function evaluates normally.
>
> Here's what the abstract should say:
>
> Function currying is the process of transforming a function that expects all
> of its arguments at once into a delayed function (called a curried function)
> that expects the remainder of the arguments to be supplied.  Once all the
> arguments are supplied, the function evaluates normally.

But isn't that just as wrong as the first version? It still seems
to be describing partial application, not currying as you defined
it above. Maybe it should say

   Function currying is the process of transforming a function that
   takes n arguments into a function that takes one argument and
   returns another function (itself also curried, if n > 2) that
   takes the remaining n-1 arguments.

Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | A citizen of NewZealandCorp, a	  |
Christchurch, New Zealand	   | wholly-owned subsidiary of USA Inc.  |
greg at cosc.canterbury.ac.nz	   +--------------------------------------+



More information about the Python-Dev mailing list