Scala language feature: Lazyness
Overview of definition keywords
Lazy val
lazy val a: Int = {
println("set!")
3
}
By-name parameters
def test(value: => Int): Int = {
if (value > 0) 0 else value * 2
}
test {
println("test")
scala.util.Random.nextInt
}
https://stackoverflow.com/questions/4543228/whats-the-difference-between-and-unit