-
-
Save rf-/1509388 to your computer and use it in GitHub Desktop.
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
[1] pry(main)> def x | |
[1] pry(main)* puts 'called x' | |
[1] pry(main)* callcc { |cc| return cc } | |
[1] pry(main)* end | |
=> nil | |
[2] pry(main)> def y | |
[2] pry(main)* puts 'called y' | |
[2] pry(main)* x.call | |
[2] pry(main)* ensure | |
[2] pry(main)* puts 'ensure block' | |
[2] pry(main)* end | |
=> nil | |
[3] pry(main)> y | |
called y | |
called x | |
ensure block | |
NoMethodError: undefined method `call' for nil:NilClass | |
from (pry):7:in `y' |
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
[4] pry(main)> def x | |
[4] pry(main)* puts 'called x' | |
[4] pry(main)* callcc { |cc| return cc } | |
[4] pry(main)* ensure | |
[4] pry(main)* puts 'ensure in x' | |
[4] pry(main)* end | |
=> nil | |
[5] pry(main)> y | |
called y | |
called x | |
ensure in x | |
ensure in x | |
ensure block | |
NoMethodError: undefined method `call' for nil:NilClass | |
from (pry):7:in `y' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment