@main def main(): Unit = // a lazy val runs its body on first use, then caches lazy val once = { println("computing"); 42 } println("before") println(once) println(once)
computed once, then cached