Skip to content

Instantly share code, notes, and snippets.

@scottcreynolds
Created October 1, 2013 19:21
Show Gist options
  • Save scottcreynolds/6783692 to your computer and use it in GitHub Desktop.
Save scottcreynolds/6783692 to your computer and use it in GitHub Desktop.
def my_while(condition, &body)
if condition.call
body.call
my_while(condition, &body)
end
end
x = 1
my_while -> {x < 10} do
puts x
x += 1
end
puts "why would I ever do this?!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment