[Python-ideas] Syntax for curried functions

Guido van Rossum guido at python.org
Tue Mar 3 23:22:25 CET 2009

Haskell has this too, perhaps even more extreme: there's not really
such a thing in Haskell as a function of N arguments (N > 1). "f a b =
..." defines a function f of one argument a which returns another
function ("f a") of one argument b. And so on.

That doesn't mean we need to copy this idea in Python.

On Tue, Mar 3, 2009 at 12:56 PM, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:
> Weeble wrote:
>> I don't think it's generally useful enough to merit
>> a change to the language, but somehow the idea floated into my head
>> and it just seemed so *neat* that I had to tell somebody.
> The designers of at least one other language seem to
> think it's neat, too. Scheme has an exactly analogous
> construct:
>  (define ((f x) y)
>    ...)
> which is shorthand for
>  (define f
>    (lambda (x)
>      (lambda (y) ...)))
> [The *really* neat thing about the Scheme version is
> the way it just naturally falls out of the macro expansion
> of 'define' in terms of 'lambda' -- so it's not really
> a separate language feature at all!]
> --
> Greg
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> http://mail.python.org/mailman/listinfo/python-ideas

--Guido van Rossum (home page: http://www.python.org/~guido/)

More information about the Python-ideas mailing list