#' Stack
#' @name stack
#' @export
#' @include container.R
NULL
stack <- Container("stack",
new = function() {
pointer <- stack_create()
local({
finalize <- function() stack_release(pointer)
empty <- function() stack_empty(pointer)
size <- function() stack_size(pointer)
push <- function(x) stack_push(pointer, x)
pop <- function() stack_pop(pointer)
top <- function() stack_top(pointer)
container(environment(), "stack")
})
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.