Last active
August 29, 2015 13:57
-
-
Save jroesch/9358764 to your computer and use it in GitHub Desktop.
while loops are just tail recursion LOLOL!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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