The def form is "by-name", its right hand side is evaluated on each use.
The is also a val form, which is "by-value"
The right-hand side of val definition is evaluated at the point of the definition itself.
Afterwards, the name refers to the value.
Source: Conditionals and Value Definitions
Login in to like
Login in to comment