Scala (still)

We might even parameterise on the unevaluated value. Declare a first-class unevaluated, parameterised value ߞ call it Thunk.

class Thunk[A](e: => A) { def exec = e }
val strategyD = new Thunk(println("strategyD"))
val strategyE = new Thunk(println("strategyE"))
def main(args: Array[String]) {
  strategyD.exec
  strategyE.exec
}