search

Home  >  Q&A  >  body text

_在ruby里是什么类型?

小弟好奇_在ruby中是什么class,便做了个实验,打开irb,输入_.class返回的是NilClass,再输入一次_.class返回的就是Class了,这是为什么?

我的版本是irb 0.95,ruby 1.87

大家讲道理大家讲道理2778 days ago654

reply all(1)I'll reply

  • PHP中文网

    PHP中文网2017-04-21 10:58:13

    After testing, I found that "_" should save the content of the last standard output of irb. Of course, since it is standard output, it does not include exception information.

    reply
    0
  • Cancelreply