From: dblack@... Date: 2007-01-04T08:11:39+09:00 Subject: Re: Little Things Hi -- On Thu, 4 Jan 2007, Martin DeMello wrote: > On 1/4/07, dblack@wobblini.net wrote: >> >> You can generally tell from the semantics of the method name. For >> example, Array#pop has no possible non-destructive meaning. (A >> non-destructive pop would just be array[-1] with an incomprehensible >> name.) There are a couple of cases where you do have to learn it... > > Array#peek, perhaps, or Array#top. I'm actually strongly in favour of > this (I even submitted an RCR some years ago), since I feel the stack > and queue methods should be capable of being used, as a group, without > having to remember which end is the stack top and which the queue > front. See my reply to James; I didn't mean that there's no good way to refer to a given item, just that pop/pop! doesn't make sense. David -- Q. What is THE Ruby book for Rails developers? A. RUBY FOR RAILS by David A. Black (http://www.manning.com/black) (See what readers are saying! http://www.rubypal.com/r4rrevs.pdf) Q. Where can I get Ruby/Rails on-site training, consulting, coaching? A. Ruby Power and Light, LLC (http://www.rubypal.com)