I am new to python. I have a few questions coming from an armature!

Lawrence D’Oliveiro lawrencedo99 at gmail.com
Mon Aug 15 20:52:35 EDT 2016


On Tuesday, August 16, 2016 at 6:36:41 AM UTC+12, sohca... at gmail.com wrote:
> What helped me understand Lambdas is figuring out that they're really just
> a $1,000 term for a $5 concept.

The excuse for the “$1,000 term” is that it came from Alonzo Church’s λ-calculus, which was an alternative formulation for computability to Turing’s eponymous machines (and introduced around the same time, in the 1930s). In λ-calculus, everything is a function--even the integers are functions. In that situation, I think you would agree it is very much a “$1,000 concept”.

Lisp was the first programming language to include the word “lambda” in a syntactic construct.

Languages like Perl and JavaScript define anonymous functions in a simple way: just omit the name from an otherwise regular function definition.

Python, on the other hand, introduces the special word “lambda” for this purpose, eschewing its usual “def”.

Why? Something to do with GvR’s allergy to anonymous functions...



More information about the Python-list mailing list