I am using an Array in Ruby as something similar to a linked list.
Thus I have ary = [1,2,3]
To insert a node I do ary.insert(2,99) resulting in [1,2,99,3]
Now the question:
How would I do the opposite??
I wish there existed a function ary.extract(2) that would return 99 and leave my array in the state [1,2,3]
slicewill do the trick: