Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Errors during eager evaluation cause result of logical expression to be lost
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