From: Daniel Schierbeck Date: 2006-09-18T19:26:05+09:00 Subject: Re: Splat, #to_ary and #to_a Marcelo Alvim wrote: > On 9/18/06, Rick DeNatale wrote: >> and which of these will change in 1.9? >> >> def a(*arg) >> p arg >> end >> >> a("foo\nbar") >> which in 1.8.4 prints ["foo\nbar"] >> >> a((1..3)) >> prints [1, 2, 3, 4] > > Does the following happen only to me? > > irb(main):001:0> def a(*arg) > irb(main):002:1> p arg > irb(main):003:1> end > => nil > irb(main):004:0> a((1..3)) > [1..3] > => nil > > Using ruby 1.8.4 (2006-04-14) [i386-mswin32]. No, it the way it's supposed to be. a (1..3) #=> outputs: [1..3] a *(1..3) #=> outputs: [1, 2, 3] Cheers, Daniel