View Single Post
Old Jan 28th, 2006, 12:59 PM   #5
Arevos
Programming Guru
 
Arevos's Avatar
 
Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5 Arevos is on a distinguished road
Quote:
Originally Posted by Cerulean
Where `function(anon)` does what exactly?
Uh, well, 'function' is a function, and 'anon' is the inline function defined in my example. For instance:
def print_output(func):
    print func(10)

def increment(x):
    return x + 1

print_output(increment)
Could have some syntactic sugar that would allow it to be re-written:
def print_output(func):
    print func(10)

use x in print_output:
   return x + 1
Arevos is offline   Reply With Quote