Created
March 1, 2015 03:07
-
-
Save tdg5/12eccaae6132e72c0490 to your computer and use it in GitHub Desktop.
Errors during eager evaluation cause result of logical expression to be lost
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
or_result = nil | |
begin | |
or_result = true | Seriously(this(is(valid(Ruby!)))) | |
rescue NameError | |
puts "NameError :(" | |
end | |
# Name Error :( | |
or_result | |
# => nil | |
and_result = nil | |
begin | |
and_result = false & 0/0 | |
rescue ZeroDivisionError | |
puts "ZeroDivisionError :(" | |
end | |
# ZeroDivisionError :( | |
and_result | |
# => nil |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment