문제

In the Scala REPL if you evaluate something its value is stored in res{N}, as is discussed here: How can I access the last result in Scala REPL?. Is there a similar feature for the ruby REPL, or do the results get lost if you don't capture their value in a variable?

도움이 되었습니까?

해결책

You can use the underscore _ in irb to refer to the last returned result:

1 + 5
# => 6

_ + 10
# => 16
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top