> Second I don't look for { or ( but for the block indentation, so a { on a single line does not give me enough visual clues.
We could argue for days about these sort of issues, and there are passionate ideas on either side of the fence.
function
{
code;
code;
}
In that form, you have the beginning { and ending } for explicitly define the beginning and ending of the code block, and all of the code inside is also indented for good measure. Maybe it's redundant, but I don't see how it's wildly different from: function
code;
code;
> Why is there }; and } ?Have you never programmer outside of lisp? I've never programmed in C#, but if 'arg =>' is the beginning of lambda, then it's because the definition of that line is return EXPRESSION;.
And in that case EXPRESSION = 'arg => { code }'. That's where the ';' comes from.
=> denotes a lambda. The left side is the args, the right side is the body. Lambdas are typically a single expression, but can have a statement body instead. A semicolon denotes the end of a statement.
var square = x => x * x;
var square = x => { return x * x; };
Second I don't look for { or ( but for the block indentation, so a { on a single line does not give me enough visual clues.
The 'return arg =>' form is not obvious to me. What does it do? Where dies TReturn come from, TParam?
Why is there }; and } ?