Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Python: currying

Name: Anonymous 2010-04-29 9:40

Suppose we have an implementation of Python in which functions support currying. We write:


def f(x, y, z):
    print(x, y, z)

f(y=2)(1)(3)


What output will be generated?

Name: Anonymous 2010-04-29 10:36

>>5
It can be rather useful. If a language lets you implement currying yourself(preferably, within a couple of lines of code), it means it's worth using.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List