Re: Array#concat Enumerator

2012-12-09 Thread Robert Klemme
On Sun, Dec 9, 2012 at 7:24 PM, Marc Heiler wrote: > Who uses .push when .<< is so much nicer. That lies in the eye of the beholder, doesn't it? A typical use case is when you want to append several values which are not stored in an Enumerable. Using << can become quite lengthy because " << " t

Re: Array#concat Enumerator

2012-12-09 Thread Intransition
> > > irb(main):013:0> ["foo"].push(*"abc".chars) > => ["foo", "a", "b", "c"] > > A bit beside the point though. I was wondering if #concat should be able to handle an Enumerator. But I didn't know push could take more than one argument, so that's something learned today. Thanks! -- You r

Re: Array#concat Enumerator

2012-12-08 Thread Robert Klemme
On Thu, Dec 6, 2012 at 10:43 AM, Intransition wrote: > Shouldn't this work? > > [].concat("abc".chars) > > Seems extraneous that one would have to do: > > [].concat("abc".chars.to_a) Then do irb(main):013:0> ["foo"].push(*"abc".chars) => ["foo", "a", "b", "c"] Cheers robert -- remember.gu

Array#concat Enumerator

2012-12-06 Thread Intransition
Shouldn't this work? [].concat("abc".chars) Seems extraneous that one would have to do: [].concat("abc".chars.to_a) -- You received this message because you are subscribed to the Google Groups ruby-talk-google group. To post to this group, send email to [email protected].