From: Martin DeMello Date: 2007-01-04T08:29:47+09:00 Subject: Re: Little Things On 1/4/07, dblack@wobblini.net wrote: > 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. Ah - yes, I see what you mean. #pop does have the destructiveness built into the name, I agree. martin