Re: (aref ary i) versus (gethash k hash) --- inconsistent?



In article <Vf2dnQepYtRk5MranZ2dnUVZ_q7inZ2d@xxxxxxxxxxxxx>,
rpw3@xxxxxxxx (Rob Warnock) wrote:

Kent M Pitman <pitman@xxxxxxxxxxx> wrote:
+---------------
| Back to the original point, I think in English, some verbs take
| postional args (objects) and some have objects that can move around,
| and some can do either. "Give John the ball" is positional.
| "Give the ball to John" takes advantage of an optional guide word.
| There is no positional for "Push x y" in English, only in nerdspeak.
| You have to say "Push x onto y" (or "into" or some other preposition).
| And having done so, you can freely move it. "Push onto y x" works, too.
| I think probably the thought at the time was that you could get just
| as used to saying "push ONTO list item" as the other, even though
| that was untested.
+---------------

Hardly "untested", since that's the way the PDP-10 opcode of the
same name worked! ;-} ;-}

PUSH LIST, ITEM

...where LIST here is the name of some general register (other
than 0) to be treated as a stack pointer (usually named "P").

And 30 years later, Perl has

push @array, $item

However, in this case I think it's for the same reason that AREF takes
the indices last: Perl's push is n-ary, i.e. you can write

push @array, $item1, $item2, ...

and varargs generally work best at the end of argument lists.

--
Barry Margolin, barmar@xxxxxxxxxxxx
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
.



Relevant Pages


Loading