# Help me understand this

**URL:** <https://www.ruby-forum.com/t/help-me-understand-this/153010>\
**Category:** Ruby\
**Created:** [November 11, 2008, 2:43am UTC](https://www.ruby-forum.com/t/help-me-understand-this/153010 "2008-11-11T02:43:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![elpee](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/dec6dc/32.png) [@elpee](https://www.ruby-forum.com/u/elpee)\
**Post date:** [November 11, 2008, 2:43am UTC](https://www.ruby-forum.com/t/help-me-understand-this/153010/1 "2008-11-11T02:43:54Z")

</div>

I have my own theory, but I haven’t seen the implementation yet. Or  
maybe it’s something simple, and I am just making things complicated.  
Here goes:

-\> irb  
irb(main):001:0\> b,c = 1,2  
=\> [1, 2]  
irb(main):002:0\> a = b,c = 1,2  
=\> [1, 1, 2]  
irb(main):003:0\> a  
=\> [1, 1, 2]  
irb(main):004:0\> a.inspect  
=\> “[1, 1, 2]”  
irb(main):005:0\> a.class  
=\> Array  
irb(main):006:0\>

---

<div class="post-metadata">

**Author:** ![elpee](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/dec6dc/32.png) [@elpee](https://www.ruby-forum.com/u/elpee)\
**Post date:** [November 11, 2008, 3:01am UTC](https://www.ruby-forum.com/t/help-me-understand-this/153010/2 "2008-11-11T03:01:31Z")

</div>

From: Elpee Zit [[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)]  
#…

this,

> b,c = 1,2  
> =\> [1, 2]  
> b  
> =\> 1  
> c  
> =\> 2

compare to this,

> b,c = [1,2]  
> =\> [1, 2]  
> b  
> =\> 1  
> c  
> =\> 2

then,

> a = b,c = 1,2  
> =\> [1, 1, 2]  
> a  
> =\> [1, 1, 2]  
> b  
> =\> 1  
> c  
> =\> 1

compare

> a = [b,(c = 1),2]  
> =\> [1, 1, 2]  
> a  
> =\> [1, 1, 2]  
> b  
> =\> 1  
> c  
> =\> 1

it’s an array all to the right…

---

<div class="post-metadata">

**Author:** ![elpee](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/dec6dc/32.png) [@elpee](https://www.ruby-forum.com/u/elpee)\
**Post date:** [November 11, 2008, 3:32am UTC](https://www.ruby-forum.com/t/help-me-understand-this/153010/3 "2008-11-11T03:32:32Z")

</div>

Thank You !!!
