Description Usage Arguments Details Value See Also Examples
The push
function inserts an
object into .stack
.
1 | push(.stack, x)
|
.stack |
A stack. |
x |
An object to insert in |
The push
function is not pure. Side effects (made on purpose) are:
.stack
is modified in the calling environment;
x
is removed (deleted) if it exists in the calling environment.
NULL
is returned invisibly.
pop
.
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
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.