Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

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

by scorpio17 (Canon)
on May 02, 2007 at 15:13 UTC ( [id://613180]=note: print w/replies, xml ) Need Help??


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

I think "shift" comes from digital electronics, i.e., the 'shift register'. In textbooks, these are drawn as a group of little boxes, 1 box per bit, and data is shifted in from left to right (low order bit first). I've never seen the term "unshift" outside of perl, but I think it's a good term for "the opposite of shift".
  • Comment on Re: Why are "push", "pop", "shift" and "unshift" so named?

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (4)
As of 2024-04-16 15:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found