List of Functions
Steven D'Aprano
steve at pearwood.info
Mon Mar 28 19:40:50 EDT 2016
On Mon, 28 Mar 2016 06:51 pm, Jussi Piitulainen wrote:
> Ben Bacarisse writes:
>
>> It's shame that anonymous functions (for that's what's being returned
>> here -- a function with no name) were born of a subject that used
>> arbitrary Greek letters for things. We seem stuck with the mysterious
>> but meaningless "lambda" for a very simple and useful idea.
I'm not sure that "lambda" is any more mysterious or meaningless than other
terms used in computing. What's a closure? A trampoline? A future? Mapping?
Thread? Greenlet? Mantissa? Not to mention terms from mathematics that
people simply memorise, like "sin", "cos", "power".
Not to mention "Monad". I don't think *anyone* knows what a Monad is ;-)
> Well said.
>
> Python should have called it "fun".
As in the 80s pop hit by Cyndia Lauper, "Girls Just Wanna Have Anonymous
Functions"?
> I have heard that the use of lambda for this purpose was originally not
> an arbitrary choice but a typographical accident. A misinterpreted caret
> or something. I also seem to remember that I've seen some discussion on
> whether the story is true or not, but I forget which way it went.
I don't know whether or not it is true, but I've heard the same thing.
Quote:
(Note: it may seem perverse to use lambda to introduce a procedure/function.
The notation goes back to Alonzo Church, who in the 1930's started with
a "hat" symbol; he wrote the square function as "ŷ . y × y". But frustrated
typographers moved the hat to the left of the parameter and changed it to a
capital lambda: "Λy . y × y"; from there the capital lambda was changed to
lowercase, and now we see "λy . y × y" in math books and (lambda (y) (* y
y)) in Lisp. If it were up to me, I'd use fun or maybe ^. )
http://norvig.com/lispy2.html
--
Steven
More information about the Python-list
mailing list