From: Matthew Kerwin Date: 2012-12-10T08:41:49+09:00 Subject: Re: Array#concat Enumerator --f46d042f9eb0ebcb7204d073fd73 Content-Type: text/plain; charset=ISO-8859-1 I've also used #push when I want to make it explicitly clear that I'm using #push and #pop as opposed to #shift and #unshift, especially when both sets of operations are possible in the same code (e.g. when using a double-ended queue). On 10 December 2012 08:15, Robert Klemme wrote: > 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 " << " takes > more space than ", ". > > Kind regards > > robert > > -- > remember.guy do |as, often| as.you_can - without end > http://blog.rubybestpractices.com/ > > -- Matthew Kerwin, B.Sc (CompSci) (Hons) http://matthew.kerwin.net.au/ ABN: 59-013-727-651 "You'll never find a programming language that frees you from the burden of clarifying your ideas." - xkcd --f46d042f9eb0ebcb7204d073fd73 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I've also used #push when I want to make it explicitly clear that I'= ;m using #push and #pop as opposed to #shift and #unshift, especially when = both sets of operations are possible in the same code (e.g. when using a do= uble-ended queue).


On 10 December 2012 08:15, Robert Klemme= <shortcutter@googlemail.com> wrote:
On Sun, Dec 9, 2012 at 7:24 PM, Marc Heiler <lists@ruby-forum.com> wrote:
> Who uses .push when .<< is so much nicer.

That lies in the eye of the beholder, doesn't it? =A0A typical us= e case
is when you want to append several values which are not stored in an
Enumerable. =A0Using << can become quite lengthy because " <&= lt; " takes
more space than ", ".

Kind regards

robert

--
remember.guy do |as, often| as.you_can - without end
http://blo= g.rubybestpractices.com/




--
= =A0 Matthew Kerwin, B.Sc (CompSci) (Hons)
=A0 http://matthew.kerwin.net.au/
=A0 = ABN: 59-013-727-651

=A0 "You'll never find a programming language that frees
= =A0 you from the burden of clarifying your ideas." - xkcd
--f46d042f9eb0ebcb7204d073fd73--