3 ms·
It's nice to be able to annotate functions that should have some optimization done to it, and then the program fails to compile if it isn't able to perform the
by Dewie 12y ago
It's nice to be able to annotate functions that should have some optimization done to it, and then the program fails to compile if it isn't able to perform the optimization.
- mpartel 12y agoScala has this: http://www.scala-lang.org/api/current/index.html#scala.annotation.tailrec http://www.scala-lang.org/api/current/index.html#scala.annot...
- Dewie 12y agoI've used it when implementing a game "loop" (just continually asking user for input to the game). It's nice to be able use recursion when you want to, and be sure that the call stack won't grow larger just by playing the game for several rounds.