Page 1 of 1
Type of parameter to Lambda
Posted: Tue Mar 27, 2018 8:57 am
by Emanuel_Swe
Hello. I wonder if there is a special reason for writing the type
in the lambda expression. You wrote that the expression in first option was syntactically correct.
Greetings V. Ekholm
Re: Type of parameter to Lambda
Posted: Tue Mar 27, 2018 10:39 am
by admin
As the explanation says, the variable name in the lambda cannot be d because d is already used in the method. That is why even though syntax of the lamda in option 1 is correct but it will not compile. Data x doesn't have that problem.
Re: Type of parameter to Lambda
Posted: Tue Mar 27, 2018 2:41 pm
by Emanuel_Swe
Thank you, I just wonder why it says "(Data x)->" and not just "(x)->"
Re: Type of parameter to Lambda
Posted: Tue Mar 27, 2018 9:06 pm
by admin
There is no special reason for that.