Skip to content

Instantly share code, notes, and snippets.

@mehdi-farsi
Last active September 13, 2018 13:00
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 mehdi-farsi/573563c8746409dfbd2ccac09e0f34b6 to your computer and use it in GitHub Desktop.
Save mehdi-farsi/573563c8746409dfbd2ccac09e0f34b6 to your computer and use it in GitHub Desktop.
for i in 1..3 do
puts "Iteration #{i}"
redo if i == 1
puts 'After redo'
end
# produces:
#
# Iteration 1
# Iteration 1
# Iteration 1
# Iteration 1
# ... infinite loop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment