From: nobu@... Date: 2006-08-18T00:08:29+09:00 Subject: Re: [Facets] Multiple arguments for Hash#delete Hi, At Thu, 17 Aug 2006 23:40:18 +0900, Daniel Schierbeck wrote in [ruby-talk:208980]: > >> Probably somewhat slower, but hey, it lets you do this > >> > >> a, b, c = hsh.delete :a, :b, :c > > > > What will be returned from `hsh.delete :a'? > > The value of :a > > hsh = {:a => 1, :b => 2, :c => 3} > hsh.delete :a, :b #=> [1, 2] > hsh.delete :c #=> 3 The class of returned value varies according to the number of arguments? > that way, you can do this > > a = hsh.delete :a > b, c = hsh.delete :b, :c a = [:b, :c] b = hsh.delete(*a) might be confusing, IMHO. -- Nobu Nakada