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/2002-March/021441.html below:

[Python-Dev] A Hygienic Macro System in Python?

[Python-Dev] A Hygienic Macro System in Python? [Python-Dev] A Hygienic Macro System in Python?Paul Prescod paul@prescod.net
Tue, 19 Mar 2002 01:05:40 -0800
Greg Ewing wrote:
> 
>...
> 
> I've been trying to think of a Pythonic syntax for passing
> code blocks to procedures. 

Mixed feelings on that...not a big fan of the Ruby indiom:

5.dotimes():
   print "Hello";

(or whatever it is...something like that) I sort of like the fact that
Python figures out what control flow features people need (e.g. foreach
and simple generators) and just implements.

>...
> except that the thunk would have to have write access to
> the namespace it's embedded in, perhaps implemented by
> sharing the stack frame.

If the idea is for it to be a macro feature then yes. But it could be
JUST an anonymous implicit thunk. Isn't that how it is in Ruby or
Smalltalk? How would the procedure know what variable names to expect in
the block?

 Paul Prescod



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