ARTICLE AD BOX
Consider the functional switch in C#, such as a trivial example (absolute value):
double x = ... x = x switch { < 0 => -x, _ => x };However, if I have a function instead:
x = fn(x) switch { < 0 => -fn(x), _ => fn(x) };it would be inefficient, and a support variable should be used.
I wonder pros and cons of "aliasing" the switch argument in order to be used as part of the results.
Let's call "arg" this alias, so that:
Is it worthwhile?
