Martin DeMello <martindemello / yahoo.com> writes:

> Yukihiro Matsumoto <matz / ruby-lang.org> wrote:
>> 
>> "top" is too generic.  One can think of arbitrary edge of an array,
>> and I'm afraid too many guess wrong side.  I did, for example.
>
> Yes, but only the first time. Though you're right, it is less
> intuitive than the other methods, since in the case of push and
> shift there *is* a definite edge associated. I guess because
> programmers have internalised the fact that arrays grow from the
> end, making the two edges different in terms of operation cost.

Actually "Array.push" and "Array.shift" are just as confusing to me as
"Array.top" would be.  It is all a matter of learning the API.
Compare:

    Does Array.push put the element onto the end or the beginning?
    Does Array.shift shift the elements to the right or left?
    Does Array.top mean the beginning or the end of the array?

They are all similar questions with no obvious answer until you learn
the answer.