Linked Questions
77 questions linked to/from What is a lambda (function)?
0 votes
0 answers
140 views
In java how are lambda expressions are different from regular functions [duplicate]
I am really thinking hard to understand why java has introduced new concept called Lambda Expression in its 8th version. I mean as far as I understand it is just like a regular function which ...
0 votes
0 answers
123 views
Lambda Explaination [duplicate]
I was reading this page and I found the following example code in the Python documentation, but I don't fully understand how the result is produced. Example: >>> def make_incrementor(n): .....
0 votes
0 answers
107 views
Why use an anonymous function as a variable? [duplicate]
Im trying to wrap my head around some basic MVC OOP coding concepts. Consider the following. private $notfound public function __construct(){ $this->notFound = function($url){ ...
1098 votes
14 answers
628k views
What are C++ functors and their uses?
I keep hearing a lot about functors in C++. Can someone give me an overview as to what they are and in what cases they would be useful?
358 votes
5 answers
664k views
How to sort with lambda in Python
I am trying to sort some values by attribute, like so: a = sorted(a, lambda x: x.modified, reverse=True) I get this error message: <lambda>() takes exactly 1 argument (2 given) Why? How do I ...
275 votes
8 answers
459k views
python max function using 'key' and lambda expression
I come from OOP background and trying to learn python. I am using the max function which uses a lambda expression to return the instance of type Player having maximum totalScore among the list players....
94 votes
14 answers
8k views
What is this 'Lambda' everyone keeps speaking of?
What is this 'Lambda' everyone keeps speaking of? A lot of people seem to love it, but all I can gather from it is it is just a way of cramming lots of lines of code into a single expression. Can ...
94 votes
7 answers
20k views
What is a Lambda?
Could someone provide a good description of what a Lambda is? We have a tag for them and they're on the secrets of C# question, but I have yet to find a good definition and explanation of what they ...
92 votes
4 answers
186k views
What is `lambda` in Python code? How does it work with `key` arguments to `sorted`, `sum` etc.?
I saw some examples using built-in functions like sorted, sum etc. that use key=lambda. What does lambda mean here? How does it work? For the general computer science concept of a lambda, see What is ...
32 votes
4 answers
18k views
Implementing an interface with two abstract methods by a lambda expression
In Java 8 the lambda expression is introduced to help with the reduction of boilerplate code. If the interface has only one method it works fine. If it consists of multiple methods, then none of the ...
31 votes
2 answers
20k views
Is it pythonic: naming lambdas
I'm beginning to appreciate the value of lambda expressions in python, particularly when it comes to functional programming, map, functions returning functions, etc. However, I've also been naming ...
18 votes
5 answers
8k views
How to call multi statements when flutter is started with =>?
I am new to flultter and dart. I see main calls the first widget as follows with added print statements. void main() { print('begin '); runApp(MyApp()); print('end'); } I see another way is ...
11 votes
11 answers
18k views
What exactly is "lambda" in Python? [duplicate]
I want to know what exactly is lambda in python? and where and why it is used. thanks
18 votes
2 answers
66k views
Argument 1 has unexpected type 'NoneType'?
I have a problem with my PyQt button action. I would like to send a String with the Function but I got this Error: TypeError: argument 1 has unexpected type 'NoneType' import sys from PyQt5....
15 votes
3 answers
5k views
Is lambda a type of higher order function?
I saw this question on one of the job postings and its asking what's a lambda function and what its relation to higher order function. I already know how to use lambda function but not quite confident ...