I am Peter Pilgrim. I watched Martin Odersky create a control abstraction in Scala. However I can not yet seem to repeat it inside IntelliJ IDEA 9. Is it the IDE?
As above yet recursive :)
def repeat(b: => Unit) = new {def until(c: => Boolean) = { b; if (c) until(c) }} var i = 0 repeat { println(i) i+=1 } until (i < 10)
It's @tailrec optimized too.
Llove scala :)