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-30 15:50

>>24
It's not an "exception", it's a part of the syntax.
He never said it wasn't a part of the syntax, but of course, if you could actually read, you would know that already.

If you're fighting with the language on intentional and rational parts of the syntax
His point was that it isn't rational, as it doesn't fit in with the rest of the syntax. No-one disputes that it was intentional.

Ruby might be more your thing, if you're into slow-as-fuck languages.
He already uses Python, so that's a given.

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