Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 Scala REPL 中,如果您评估某些内容,则其值存储在 res{N} 中,如下所述:如何访问 Scala REPL 中的最后一个结果?. ruby REPL 是否有类似的功能,或者如果您没有在变量中捕获它们的值,结果是否会丢失?
您可以使用_irb 中的下划线来引用最后返回的结果:
_
1 + 5 # => 6 _ + 10 # => 16