-
a) In Scala, why does evaluate by name mean that the expression has to be re-evaluated each time?
-
b) Why can it not be evaluated once and substituted in each time?
-
c) What can you do in your code to evaluate it once, such that the performance overhead is the same as call by value?
- You have seen that evaluating a recursive function that never returns will continue forever, not returning a value (similar to a infinite loop). What would be the benefit of a language that disallowed such features? What would be the drawbacks?