2007-05-22から1日間の記事一覧
普段使っているputsはどのクラスのメソッドなのだろう。riを使って探してみる。 C:\WORK> ri puts More than one method matched your request. You can refine your search by asking for information on one of: IO#puts, Kernel#puts, StringIO#puts, Zli…
irbを使うときにはprintはいらないのね。 C:\WORK> irb irb(main):001:0> print "Rubyco" Rubyco=> nil Rubycoの部分はprintの結果でた文字で、nilは(print "Rubyco")の値 irb(main):002:0> "Rubyco" => "Rubyco" irb(main):003:0>^Dabsしてみる。 C:\WORK> …
Windows XPのコマンドプロンプトでCTRL+Dを打ってもEOF代わりになるみたい。へえ。いままでCTRL+Zを使っていたよ。 C:\WORK> ruby print "Rubyco" ^D RubycoPerlでも同じですね。 C:\WORK> perl print "Rubyco" ^D Rubyco追記:a3さんから「ファイルおよびデ…