Skip to content

Instantly share code, notes, and snippets.

@mgreenly
Created June 8, 2011 16:01
Show Gist options
  • Save mgreenly/1014710 to your computer and use it in GitHub Desktop.
Save mgreenly/1014710 to your computer and use it in GitHub Desktop.
ruby catch/throw
def next
loop do
if cache.empty?
cache.concat(next_block)
if cache.empty?
nil
else
redo
end
else
cache.shift
end
break
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment