Skip to content

Latest commit

 

History

History
17 lines (7 loc) · 568 Bytes

additional_qs.md

File metadata and controls

17 lines (7 loc) · 568 Bytes

Week 1

Q1

  • 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?

Q2

  • 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?