[Python-ideas] Ruby-style Blocks in Python Idea

average dreamingforward at gmail.com
Mon Mar 9 21:22:53 CET 2009


> average wrote:
> Perhaps I've misunderstood, but both Perl and Javascript (highly
> popular languages by any standard) support "passing around code
> blocks" by defining anonymous functions. How can you say that most
> languages like Python have never experimented with this, when of the
> more popular programming languages, Javascript and Perl are the most
> obviously similar to Python (besides Ruby)?

You're likely right.  And I'm probably being sloppier than I should.
My point was really more about how the art of programming has yet to
really explore the concept and power of code-blocks adequately.  Most
of us are comfortably stuck in our decades of procedural programming
experience.

What's misleading about framing this discussion is that all of us are
[over]used to the "flatland" of the program editor.  Code blocks
appear on the screen like any other code, but the *critical* point is
that LOGICALLY they are ORTHOGONAL to it.  Where most of your code
could be organized in a tree-like fashion rooted in your program's
"main" node, code blocks are orthogonal and are really like leaves
spanning back into the screen to a *different* tree's root (the
*application's* surface) hence its subtlety.

Hoping that analogy is more useful....

marcos



More information about the Python-ideas mailing list