[Python-Dev] Re: PEP 309, function currying
Peter Harris
scav at blueyonder.co.uk
Mon Feb 23 18:45:00 EST 2004
Greg Ewing wrote:
> 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.
>
>
>
Yes, that's currying alright, which PEP 309 does in no way describe.
Hmm.
OK, there is way too much imprecise thinking behind that PEP. Sorry.
I did originally describe it as a closure in the first version, then
someone corrected me about that too. I'll give the wording some more
thought, but the problem I have is that to be useful, the class or function
that implements it has to have a wieldy and clear name.
Myself, I wouldn't like to use PartiallyApply(fn,*args,**kw).
Quick unscientific name poll. Who likes...
* curry()
* closure()
* partial()
* partial_apply()
* delayed()
* other ?
Thanks for your thoughts, folks.
Peter Harris
scav at blueyonder, co, uk
More information about the Python-Dev
mailing list