0

[ANSWERED] Lambdas

What the advantage of creating lambda functions over conventional ones? (Just studying tutorial)

21st Sep 2017, 6:13 PM
Alex Snaidars
Alex Snaidars - avatar
2 Antworten
21st Sep 2017, 6:21 PM
Ferhat Sevim
Ferhat Sevim - avatar
+ 2
Let's use an analogy. Suppose you go through each line of code. You get a function statement. Now, here you can do 2 things. You can take the address where function is go and jump directly to end, execute it and finally using address come back to original location. but suppose if I give you a machine which contains how function behaves. So when you encounter a function call you can immediately execute the function without going anywhere then it would be too much fast. This is what lambdas does.However don't give too much code as it can cause memory cost!!!
21st Sep 2017, 6:43 PM
abhishek tiwari
abhishek tiwari - avatar