INFO5101 - Exam Flashcards
What are the data structures which represent the logic of the lambda expressions and can be examined by other code called?
Expression Trees
Lambda expressions can be seen as an evolution of what?
Anonymous Methods
What is the maximum number of parameters a Func<> declaration can include?
16
What is an example of a Func delegate signature that takes 2 arguments?
TResult Func<T1, T2, TResult>(T1 arg1, T2 arg2)
What is the last type parameter in a Func delegate?
The return type
What is the return type of an Action<…> delegate?
Void
What is the lambda declaration operator?
=>
What operator means “goes to”
Lambda Declaration Operator (=>)
What is on the left hand side of the lambda declaration operator?
Parameter List
What is on the right hand side of the lambda declaration operator?
Method Body
What is an implicitly typed lambda expression?
Comma-separated list of names without types for the parameter list
What is the rule with implicitly typed lambda expressions?
All parameters must be implicit or explicit. Cannot mix and match
When MUST you use explicit typing with lambda expressions?
If any parameters are “out” or “ref”
Which expressions are created first in expression trees?
Leaf expressions
What is meant by “expressions are immutable”?
Once created it cannot change
What do you get when you combine lambda expressions, expression trees, and extension methods?
Language side of LINQ
Extension methods can only be declared in what type of class?
Static