3 ms·
scala's call-by-name is often used for implementing control-flow like structures, so you can understand why they would want to be able to evaluate it more than
by kybernetikos 11y ago
scala's call-by-name is often used for implementing control-flow like structures, so you can understand why they would want to be able to evaluate it more than once. Having said that, there are so many situations where it can be surprising, I'd probably have had a rule that you have to use {} to indicate call-by-name arguments at call site.