MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ruby/comments/mkrdm/ruby_golf/c31tlcb/?context=3
r/ruby • u/[deleted] • Nov 21 '11
7 comments sorted by
View all comments
4
I don't think mass assignment actually helps...
a,b,c=1,2,3 a=1;b=2;c=3
2 u/Amadan Nov 22 '11 Helps in some cases, mainly for deconstructing arrays.b=a[0];c=a[1] b,c=aObviously, not in the example he gave. 1 u/matchu Nov 22 '11 Aha, nice :) Thanks! 2 u/taw Nov 22 '11 Even better trick:a=b[0] a,=b
2
Helps in some cases, mainly for deconstructing arrays.
b=a[0];c=a[1] b,c=a
Obviously, not in the example he gave.
1 u/matchu Nov 22 '11 Aha, nice :) Thanks! 2 u/taw Nov 22 '11 Even better trick:a=b[0] a,=b
1
Aha, nice :) Thanks!
2 u/taw Nov 22 '11 Even better trick:a=b[0] a,=b
Even better trick:
a=b[0] a,=b
4
u/matchu Nov 22 '11
I don't think mass assignment actually helps...