puts nil

Discussion in 'Ruby' started by S. Robert James, Feb 22, 2007.

  1. puts nil outputs "nil". Shouldn't it output "" (ie, nothing), which
    is nil.to_s?

    RDoc (for IO#print, referenced by #puts):
    Objects that aren't strings will be converted by calling their to_s
    method
     
    S. Robert James, Feb 22, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Brian Candler

    puts nil generates "nil\n"

    Brian Candler, Nov 6, 2004, in forum: Ruby
    Replies:
    1
    Views:
    113
  2. Christoffer Sawicki
    Replies:
    5
    Views:
    264
    Christoffer Sawicki
    Sep 2, 2006
  3. Arfon Smith

    puts returns nil?

    Arfon Smith, Jan 5, 2007, in forum: Ruby
    Replies:
    5
    Views:
    102
    Arfon Smith
    Jan 5, 2007
  4. Michael Brooks
    Replies:
    22
    Views:
    415
    Rick DeNatale
    Mar 27, 2007
  5. Raj Singh
    Replies:
    4
    Views:
    143
    Ryan Ingram
    Jan 29, 2008
Loading...

Share This Page