Lambda Expressions, Delegates, Anonymous Functions, Closures, First-Class Objects/Functions

Get Started. It's Free
or sign up with your email address
Rocket clouds
Lambda Expressions, Delegates, Anonymous Functions, Closures, First-Class Objects/Functions by Mind Map: Lambda Expressions, Delegates, Anonymous Functions, Closures, First-Class Objects/Functions

1. Lambda Expressions

1.1. an anonymous function

1.1.1. It seems people are at odds on this...

1.2. Other definitions

1.2.1. A lambda expression is a function passed into another function as a variable

1.2.1.1. Page 31 of Web Scraping with Python

1.2.2. Lambda expressions are code that can be represented either as a delegate, or as an expression tree that compiles to a delegate

1.2.2.1. Lambda Expressions (C# Programming Guide)

2. Delegates

2.1. a function pointer

2.1.1. Stack Overflow (2nd Answer)

3. Anonymous Functions

3.1. a function not bound to an identifier

3.1.1. Source: Hashnode

3.2. Example

4. Closures

4.1. a stateful function

4.2. Closures kind of remind me of classes in Java. The variables defined in the outer function are accessible in the inner function just like a member variable in a class is accessible to its methods.

4.2.1. Link is pretty good... "Master the JavaScript interview"

4.3. Example

4.4. More definitions

4.4.1. A function defined within another function, but the inner function remembers the environment in which it was created

4.4.1.1. In other words, the inner function has access to the outer function's variables and parameters

4.4.2. A closure is the combination of a function and the lexical environment within which that function was declared.

4.4.2.1. What is 'lexical'?

4.4.2.1.1. Relating to words or vocabulary

4.4.2.1.2. Lexical analysis

4.4.2.1.3. Lexical scope

5. Why are these all defined in this one mind map together?

5.1. They are important concepts in Functional Programming.

6. First-Class Citizen

6.1. Four rights and privileges

6.1.1. 1. To be assigned to a variable

6.1.2. 2. To be passed as arguments

6.1.3. 3. To be returned from a function

6.1.4. 4. To be stored in data structures

6.2. No restrictions on use

6.3. Same rights as other variables

7. First-Class Functions

7.1. Function that can

7.1.1. Be passed as an argument

7.1.2. Be returned from a function

7.1.3. Be stored in a data structure

7.1.4. Be assigned to a variable