x <- fastqueue2()
# add elements
x$madd(1, "b", function(){ "c" }, 4, "5")
# print information
print(x)
# get the second element without changing the queue
x[[2]]
# remove and get the first element
x$remove()
# the second item
x[[2]]
# first two items in a list
x[c(1,2)]
print(x)
as.list(x)
Run the code above in your browser using DataLab