def loop: Boolean = loop
A definition
def x = loop
is OK, but a definition
val x = loop
will lead to an infinite loop.
val x = 2
val y = square(x)
The right-hand side of a val definition is evaluated at the point of
the definition itself.
Login in to like
Login in to comment