Skip to content

Instantly share code, notes, and snippets.

@ismaelga
Created November 12, 2013 23:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ismaelga/7440882 to your computer and use it in GitHub Desktop.
Save ismaelga/7440882 to your computer and use it in GitHub Desktop.
my repeat
def myRepeate(command: => Unit) = new {
def until(condition: => Boolean): Unit =
if (condition) ()
else {
command
until(condition)
}
}
var x = 0
myRepeate {
x += 1
println(x)
} until (x >= 10)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment