in reply to Why are "push", "pop", "shift" and "unshift" so named?
I would say 'shift' comes from shell scripting, where you 'shift' the arguments off of the list passed to the script. This is a fairly natural usage, and might also derive from assembly language, where a basic operation is to shift all the bits in a register one place left or right.
'unshift' is probably originates with perl and would have been named by analogy with 'shift' I think.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Why are "push", "pop", "shift" and "unshift" so named?
by bart (Canon) on May 02, 2007 at 13:37 UTC |