What is the Scala annotation to ensure a tail recursive function is optimized?
Asked 2010-06-24T21:48:21.417
111
I think there is @tailrec annotation to ensure the compiler will optimize a tail recursive function. Do you just put it in front of the declaration? Does it also work if Scala is used in scripting mode (for instance using :load <file> under REPL)?