From: dblack@... Date: 2007-02-16T03:44:23+09:00 Subject: Re: is it behaving strange ? Hi -- On Fri, 16 Feb 2007, Jacob Fugal wrote: > On 2/15/07, sur max wrote: >> *a = 9 # i like this number :) > ... >> a << 5 >> b = *a # => [9,5] ------- an Array >> here it seems false "*x equals [x] without the []" > > Actually, the "rule" still applies, in that: > > b = *a # where a = [9, 5] > > and > > b = 9, 5 > > Have the same effect. You were just forgetting to consider that b > would just slurp them back into an array. > >> *a # => compile error > > This seems to be the only remaining "anomaly". It isn't, though: irb#1(main):017:0> a = [9,5] => [9, 5] irb#1(main):018:0> *a SyntaxError: compile error (irb#1):18: syntax error from (irb#1):18 irb#1(main):019:0> 9,5 SyntaxError: compile error (irb#1):19: syntax error from (irb#1):19 David -- Q. What is THE Ruby book for Rails developers? A. RUBY FOR RAILS by David A. Black (http://www.manning.com/black) (See what readers are saying! http://www.rubypal.com/r4rrevs.pdf) Q. Where can I get Ruby/Rails on-site training, consulting, coaching? A. Ruby Power and Light, LLC (http://www.rubypal.com)