2009/2/26 [email protected] [email protected]:
=> #Object:0x100af964
[1] + o
=> [1, :ary]
The #to_splat method seems to be gone.
Here’s another test set
09:31:50 OPSC_Gold_bas_dev_R2.0_foundation$ ruby /tmp/o.rb
“1.8.7”
1
2
3
“--------------”
#Object:0x1002dfcc
nil
nil
“--------------”
5
6
7
“--------------”
5
6
7
“==============”
1
2
3
“--------------”
error
error
5
6
7
“--------------”
09:31:55 OPSC_Gold_bas_dev_R2.0_foundation$ ruby19 /tmp/o.rb
“1.9.1”
1
2
3
“--------------”
#Object:0x1001a3dc
nil
nil
“--------------”
#Object:0x1001a378
nil
nil
“--------------”
5
6
7
“==============”
1
2
3
“--------------”
error
error
error
09:31:57 OPSC_Gold_bas_dev_R2.0_foundation$ cat /tmp/o.rb
p RUBY_VERSION
def t(a,b,c)
p a,b,c, ‘--------------’
end
o = Object.new
def o.to_a
[1,2,3]
end
q = Object.new
def q.to_ary
[5,6,7]
end
a, b, c = *o
p a,b,c, ‘--------------’
a, b, c = o
p a,b,c, ‘--------------’
a, b, c = *q
p a,b,c, ‘--------------’
a, b, c = q
p a,b,c, ‘==============’
t(*o) rescue puts “error”
t(o) rescue puts “error”
t(q) rescue puts “error”
t(*q) rescue puts “error”
09:32:04 OPSC_Gold_bas_dev_R2.0_foundation$
Cheers
robert