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 14:02

>>17
where assignments counted as expressions (any procedural language worth its bits)
THIS IS WHAT PERL PROGRAMMERS ACTUALLY BELIEVE

Seriously this is a horrible misfeature and only serves to make programs "clever" at the extreme expense of readability and maintainability. I'd wager that in any sane application (i.e. not deliberately obfuscated) using the value of an assignment in an expression is 90% of the time a typo.

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