A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2005-April/052717.html below:

[Python-Dev] anonymous blocks

[Python-Dev] anonymous blocks [Python-Dev] anonymous blocksShannon -jj Behrens jjinux at gmail.com
Tue Apr 19 20:35:21 CEST 2005
(I apologize that this is my first post.  Please don't flame me into
oblivion or think I'm a quack!)

Have you guys considered the following syntax for anonymous blocks?  I
think it's possible to parse given Python's existing syntax:

   items.doFoo(
       def (a, b) {
           return a + b
       },
       def (c, d) {
           return c + d
       }
   )

Notice the trick is that there is no name between the def and the "(",
and the ")" is followed by a "{".

I understand that there is hesitance to use "{}".  However, you can
think of this as a Python special case on the same level as using ";"
between statements on a single line.  From that perspective, it's not
inconsistent at all.

Best Regards,
-jj
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4