+ 14

Are anonymous functions and lambda functions same?

lambda functions seem to have lambda calculus related to them, while I didn't get any reference to lambda calculus when I learnt anonymous functions

5th Jun 2018, 4:48 PM
DAB
DAB - avatar
9 Answers
+ 9
Pretty much. It's taken from lambda calculus but in programming we use the term lambda pretty casually for anything that is (kind of) a function and (kind of) has no name. Javascript "lambdas" actually have a name. I present to you the useless (non-)lambda: let fn = function(){ return arguments.callee; }; fn()()()()()()()()()()()()()()()()()()(); `arguments.callee` will always return the function it sits in, thereby giving it a name! Still, it's lambda enough so we call it lambda. Before java got lambda-lambdas, people were calling anonymous subclasses "lambdas" too, probably because "anonymous subclass" is a mouthful. Of course it's not a function but a class, but whatever, it's lambda enough. Runnable x = new Runnable(){ public void run(){ ... } }; Other languages have pretty un-lambda lambdas too, but you get the idea. It's not an exact science, though maybe other people would disagree. (Although I can talk about lambda calculus and "real lambdas" if you want)
5th Jun 2018, 5:31 PM
Schindlabua
Schindlabua - avatar
+ 3
1. Iam not sure 2. lambda is a shortcut to define functions. These functions has parameters and a return value but to assign a name to this function is optional. 3. I think anonymous functions are functions without name. This sounds maybe useless but when you have a function, which takes another function as parameter it is not necessary to assign a name to the function. syntax of lambda: fName=lambda params: retvalue https://code.sololearn.com/csNrZ7KPcU62/?ref=app
5th Jun 2018, 5:35 PM
Tim
Tim - avatar
0
most
6th Jun 2018, 6:51 AM
Wrong Side
Wrong Side - avatar
0
Too muct
6th Jun 2018, 6:52 AM
Wrong Side
Wrong Side - avatar
0
yes
7th Jun 2018, 8:39 AM
Vlad
Vlad - avatar
0
i think,yes.
9th Jun 2018, 3:47 AM
Durgesh Kumar Maurya
Durgesh Kumar Maurya - avatar
0
yes
16th Sep 2018, 8:25 PM
kingsley Okpara
kingsley Okpara - avatar
0
Yes.
20th Sep 2019, 4:33 PM
YEMIH LEONARD
0
Yess
11th Aug 2020, 11:29 AM
Godhat Happy
Godhat Happy - avatar