push: Insert an object into a stack

Description Usage Arguments Details Value See Also Examples

Description

The push function inserts an object into .stack.

Usage

1
push(.stack, x)

Arguments

.stack

A stack.

x

An object to insert in .stack.

Details

The push function is not pure. Side effects (made on purpose) are:

Value

NULL is returned invisibly.

See Also

pop.

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.