小编Key*_*hah的帖子

Ruby是否使用$ stdout来编写puts和return的输出?

我想知道Ruby使用的输出流在命令行打印这些东西:

irb(main):001:0> a="test"
=> "test"
irb(main):002:0> puts a
test
=> nil
irb(main):003:0> a
=> "test"
Run Code Online (Sandbox Code Playgroud)

是$stdout用于irb(main):002:0>和irb(main):003:0>?而且,$stdout这两次调用之间的价值是否有任何变化?

还有,有人可以指出我从这些东西打印/写入的Ruby源代码?

ruby irb pry

5
推荐指数
1
解决办法
6660
查看次数

标签 统计

irb ×1

pry ×1

ruby ×1