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/053016.html below:

[Python-Dev] defmacro (was: Anonymous blocks)

[Python-Dev] defmacro (was: Anonymous blocks) [Python-Dev] defmacro (was: Anonymous blocks)Greg Ewing greg.ewing at canterbury.ac.nz
Wed Apr 27 02:27:17 CEST 2005
flaig at sanctacaris.net wrote:
> Actually I was thinking of something related the other day:
 > Wouldn't it be nice to be able to define/overload not only
 > operators but also control structures?

That triggered off something in my mind that's somewhat
different from what you went on to talk about.

So far we've been talking about ways of defining new
syntax. But operator overloading isn't creating new
syntax, it's giving a new meaning to existing syntax.
So the statement equivalent of that would be defining
new meanings for *existing* control structures!

For example, when you write

   while expr:
     ...

it gets turned into

   expr.__while__(thunk)

etc.

No, I'm not really serious about this -- it was just
a wild thought!

-- 
Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | A citizen of NewZealandCorp, a	  |
Christchurch, New Zealand	   | wholly-owned subsidiary of USA Inc.  |
greg.ewing at canterbury.ac.nz	   +--------------------------------------+
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