pop {flifo} | R Documentation |
Retrieve an object from a stack
Description
The pop
function retrieves the first reachable
object from .stack
.
Usage
pop(.stack)
Arguments
.stack |
A stack. |
Details
The pop
function is not pure. Side effect is that
.stack
is modified in the calling environment.
Value
The object retrieved.
If .stack
is empty, an error is thrown.
See Also
push
.
Examples
(s <- lifo(max_length = 3)) # empty LIFO
(push(s, 0.3)) #
(push(s, data.frame(x=1:2, y=2:3)))
obj <- pop(s) # get the last element inserted
[Package flifo version 0.1.5 Index]