Skip to content

Instantly share code, notes, and snippets.

@jroesch
Last active August 29, 2015 13:57
Show Gist options
  • Select an option

  • Save jroesch/9358764 to your computer and use it in GitHub Desktop.

Select an option

Save jroesch/9358764 to your computer and use it in GitHub Desktop.
while loops are just tail recursion LOLOL!
Welcome to Scala version 2.10.3 (Java HotSpot(TM) 64-Bit Server VM, Java 1.7.0_21).
Type in expressions to have them evaluated.
Type :help for more information.
scala> :power
** Power User mode enabled - BEEP WHIR GYVE **
** :phase has been set to 'typer'. **
** scala.tools.nsc._ has been imported **
** global._, definitions._ also imported **
** Try :help, :vals, power.<tab> **
scala> reify { var i = 0; while(i < 10) { i += 1 }
| }
res0: $r.intp.global.Expr[Unit] =
Expr[Unit]({
var i = 0;
while$1(){
if (i.$less(10))
{
i = i.$plus(1);
while$1()
}
else
()
}
})
scala>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment