splat operator Question.

Discussion in 'Ruby' started by Pedro Del Gallego, May 20, 2007.

  1. Hi there. What's the functional difference between

    pet1, pet2, pet3 =3D *["duck", "dog", "cat"]

    and

    pet1, pet2, pet3 =3D ["horse", "cow", "goat"]

    I get the same results=96namely, each pet gets one value from the array.

    This is a user comment in one post [1] in my blog

    [1] :

    --=20
    -------------------------------------
    Pedro Del Gallego

    Email :
    Pedro Del Gallego, May 20, 2007
    #1
    1. Advertising

  2. Pedro Del Gallego, May 20, 2007
    #2
    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. Daniel Berger

    Doing a splat within a C extension

    Daniel Berger, Nov 3, 2005, in forum: Ruby
    Replies:
    3
    Views:
    122
  2. Eero Saynatkari

    Splat, #to_ary and #to_a

    Eero Saynatkari, Sep 18, 2006, in forum: Ruby
    Replies:
    18
    Views:
    230
    Rick DeNatale
    Sep 20, 2006
  3. Adam Shelly

    redefining splat?

    Adam Shelly, Oct 2, 2006, in forum: Ruby
    Replies:
    10
    Views:
    343
    Martin Coxall
    Oct 3, 2006
  4. RichardOnRails

    What am I missing about splat operator?

    RichardOnRails, Dec 29, 2010, in forum: Ruby
    Replies:
    8
    Views:
    113
    Ryan Davis
    Dec 30, 2010
  5. Gunther Diemant

    Splat operator gives an SystemStackError

    Gunther Diemant, Mar 4, 2011, in forum: Ruby
    Replies:
    2
    Views:
    105
    Gunther Diemant
    Mar 4, 2011
Loading...

Share This Page