in reply to Last position of array

You have four primitives that treat an array like a push-down stack or a queue: push/pop, shift/unshift.