From: ara.t.howard@... Date: 2007-01-04T08:06:07+09:00 Subject: Re: Little Things On Thu, 4 Jan 2007 dblack@wobblini.net wrote: > Hi -- > > On Thu, 4 Jan 2007, James Edward Gray II wrote: > >> On Jan 3, 2007, at 4:27 PM, dblack@wobblini.net wrote: >> >>> (A non-destructive pop would just be array[-1] with an incomprehensible >>> name.) >> >> Array#last > > OK; it would just be Array#last with an incomprehensible name :-) > > What I was getting at was that there's no point having pop and pop! > since a non-destructive method called "pop" makes no sense. i never thought of this, but in cases like pop/delete the bang version could be used to return self: # # ejects last element # # hop = on.pop # def pop ... end # # ejects last element and returns self, eg # # a.pop!.size # def pop! ignored = pop self end the 'dangerous' bit here is that the value is thrown in the bit bucket. not that i disagree with you - i just happen to have this thought... -a -- if you find yourself slandering anybody, first imagine that your mouth is filled with excrement. it will break you of the habit quickly enough. - the dalai lama