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
Войдите чтобы поставить Нравится
Войдите чтобы прокомментировать