Skip to content

Instantly share code, notes, and snippets.

@nanne007
Last active December 28, 2015 07:09
Show Gist options
  • Save nanne007/7462368 to your computer and use it in GitHub Desktop.
Save nanne007/7462368 to your computer and use it in GitHub Desktop.
repeat { command } until(condition) syntax in scala
def repeat(c: => Unit) = new {
def until(p: => Boolean): Unit = {
c
if(p) ()
else until(p)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment