From: Robert Dober Date: 2006-10-26T01:55:41+09:00 Subject: Re: '**' as hash splat? ------=_Part_33516_30142624.1161795338843 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 10/24/06, Trans wrote: > > > > > > > > > h = {:b=>2, :a=>1} > > > {:c => 3, **h} #=> {:c=>3, :b=>2, :a=>1} I want this toy +1 > > > > > T. > > > Not so for Ruby 2.0, assuming we do indeed get key parameters: > > def foo( **keys ) > p keys > end > > > If you want to combine hashes, use the merge method > > > > {:c=>3}.merge(h) #=> {:a=>1, :b=>2, :c=>3} > > And with arrays one can use #+. That's fine, but it lacks a certain > elegance in some instances. > T. Completely agree Robert -- The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore all progress depends on the unreasonable man. - George Bernard Shaw ------=_Part_33516_30142624.1161795338843--