From: John Barnette Date: 2008-03-11T15:12:20+09:00 Subject: Re: is this a feature or a bug? On Mon, Mar 10, 2008 at 10:59 PM, Rie! wrote: > sorry if it's been discussed as i don't know what the search keyword > for this scenario. it actually came up from _mistype_ (notice the > comma). > > m:~ arie$ irb > >> h = {} > => {} > >> h[:a] = 1, > ?> h[:b] = 2 > => [1, 2] > >> h > => {:a=>[1, 2], :b=>2} This is expected behavior. You've assigned a two-element list to h[:a] - the number 1 - an assignment expression yielding the number 2 Since assignment expressions return their rval, everything's happy and legal. This one-line version behaves identically to what you've typed: h[:a] = [1, h[:b] = 2] ~ j.