Code blocks as parameters (Re: what's in a name (was Re: using lambda to print everything in a list))

Greg Ewing see at my.signature
Tue May 1 02:05:44 EDT 2001


James_Althoff at i2.com wrote:
> 
> window.showWaitCursorDuring:
>     line1-of-code
>     line2-of-code
>     . . .
>     lineN-of-code

For a while I've been thinking about making something like

  func(arg1,arg2):
    statements

mean the same as (except for the local function name):

  def thunk():
    statements
  func(thunk,arg1,arg2)

But then someone is going to want to pass arguments
to the thunk, and I haven't thought of a good
syntax for that yet.

-- 
Greg Ewing, Computer Science Dept, University of Canterbury,	  
Christchurch, New Zealand
To get my email address, please visit my web page:	  
http://www.cosc.canterbury.ac.nz/~greg



More information about the Python-list mailing list