Mention "anonymous functions" and you just might bewilder a mathematician but a programmer will simply nod with understanding.

It turns out the concept itself is not unfamiliar to mathematicians, it's just they never bothered to christen the concept: anonymous functions are functions that are not bound to a name. (Can you say "Duh"?)

The function is not anonymous, its name is ; its anonymous version is .

In Python a function is defined like so:

[python]

def f(x):

return 2*x

[/python]

Anonymous functions are defined using the construct :

[python]

g = lambda x : 2*x

[/python]

And, oh, the irony, I assigned the name to the anonymous function!

Anonymous Functions