2 ms·
I've used Scala's call-by-name, but what I really wanted was call-by-let taking the argument as pure and evaluating at most once in the called function.
by karmakaze 11y ago
I've used Scala's call-by-name, but what I really wanted was call-by-let taking the argument as pure and evaluating at most once in the called function.
- kybernetikos 11y agoscala'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.