title: What is the Scala annotation to ensure a tail recursive function is optimized?
body: <p>I think there is <code>@tailrec</code> 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 <code>:load &lt;file&gt;</code> under REPL)?</p>