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

Greg Ewing see at my.signature
Thu May 3 02:04:50 EDT 2001


Roman Suzi wrote:
> 
> If you want arguments, then Python need a syntax
> for functions with partially binded args

No, I was thinking of cases where the func passes
arguments to the thunk when it calls it, so you can
do things like

  def thunk(x):
    do_something_with(x)
  mycollection.foreach(thunk)

Currying isn't needed for that, only some place to
put the formal parameters of the thunk. My proposed
syntax didn't have that, since the thunk didn't have
an explicit header.

-- 
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