I\'ve been learning scala and I gotta say that it\'s a really cool language. I especially like its pattern matching capabilities and function literals but I come from a javascri
I think what you mean "lazy function" is function literal or anonymous function.
In Scala you could do things like this, very similar to the javascript code you posted.
val foo = () => {
val t = new Date()
val foo = () => {t}
foo()
}
println ("Hello World:" + foo())
The main difference is that: