[1] pry(main)> 1 + 2
=> 3
[2] pry(main)> _
=> 3
[3] pry(main)> 1 + _
=> 4
[4] pry(main)> exit
➜ ~ pry
[1] pry(main)> _.class
=> NilClass
[2] pry(main)> _
=> NilClass
[3] pry(main)> 1 + 2
=> 3
[4] pry(main)> x
NameError: undefined local variable or method `x' for main:Object
from (pry):4:in `<main>'
[5] pry(main)> _
=> 3
[6] pry(main)> 1 + _
=> 4
[7] pry(main)> _.class
=> Fixnum
[8] pry(main)>
'_' 不是在 ruby中定义的变量 ,是 ruby的 REPL 环境中上一次 eval 的值