Todd Benson
3/11/2008 6:18:00 AM
On Tue, Mar 11, 2008 at 12:59 AM, Rie! <ariekusumaatmaja2@gmail.com> 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}
Feature, I think. Otherwise, you wouldn't be able to do things like...
a, b = b, a
The comma, it seems, assumes precedence from the right side.
Todd