pop: Retrieve an object from a stack

Description Usage Arguments Details Value See Also Examples

Description

The pop function retrieves the first reachable object from .stack.

Usage

1
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

1
2
3
4
(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

flifo documentation built on May 2, 2019, 1:26 a.m.