Re: [Rails] Re: Good Ruubyist way

2013-05-25 Thread Jordon Bedwell
On Fri, May 24, 2013 at 10:33 AM, Paul Julian wrote: > a = [1,2,3,4,5,6,7,8,9,10] > b= a.reverse.reverse Can't tell if you are trolling or if you think that's actually a good idea. How about just doing: a = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] b = a.dup > > On Friday, May 24, 2013 9:56:39 AM UTC-4,

[Rails] Re: Good Ruubyist way

2013-05-25 Thread Paul Julian
a = [1,2,3,4,5,6,7,8,9,10] b= a.reverse.reverse On Friday, May 24, 2013 9:56:39 AM UTC-4, Ruby-Forum.com User wrote: > > a = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] > b = a + [nil] > p a #=> [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] > p b #=> [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, nil] > > Is there any other Rubyist w

Re: [Rails] Re: Good Ruubyist way

2013-05-24 Thread Colin Law
On 24 May 2013 16:20, Love U Ruby wrote: > Colin Law wrote in post #1110051: >> On 24 May 2013 14:56, Love U Ruby wrote: >>> a = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] >>> b = a + [nil] >>> p a #=> [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] >>> p b #=> [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, nil] >>> >>> Is there any othe

[Rails] Re: Good Ruubyist way

2013-05-24 Thread Love U Ruby
Colin Law wrote in post #1110051: > On 24 May 2013 14:56, Love U Ruby wrote: >> a = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] >> b = a + [nil] >> p a #=> [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] >> p b #=> [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, nil] >> >> Is there any other Rubyist way to get the `b` array from `a` array?