Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Why are "push", "pop", "shift" and "unshift" so named?

by ambrus (Abbot)
on May 02, 2007 at 14:06 UTC ( #613164=note: print w/replies, xml ) Need Help??


in reply to Why are "push", "pop", "shift" and "unshift" so named?

Shift is from the builtin command of same name in unix shells. It shifted a command-line argument from the beginning, so that if you used it in a loop, you could loop through command-line arguments in normal order. Even the DOS command.com has copied that command with the same name.

Update: I see jbert has already said this in his reply.

  • Comment on Re: Why are "push", "pop", "shift" and "unshift" so named?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://613164]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2019-11-22 00:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Strict and warnings: which comes first?



    Results (107 votes). Check out past polls.

    Notices?