% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/30-api-flexseq-ends.R
\name{push_back}
\alias{push_back}
\title{Push an Element to the Back}
\usage{
push_back(x, value)
}
\arguments{
\item{x}{A \code{flexseq}.}

\item{value}{Element to append.}
}
\value{
Updated \code{flexseq}.
}
\description{
Returns a new sequence with \code{value} appended at the right end.
}
\details{
This operation is persistent: \code{x} is not modified.

Elements can be named, but only if all are uniquely named (no missing
names).
}
\examples{
s <- as_flexseq(letters[1:3])
s2 <- push_back(s, "d")
s2
s  # unchanged

n <- as_flexseq(list(two = 2, three = 3))
new_el <- 4
names(new_el) <- "four"
push_back(n, new_el)

# Named/unnamed mixes are rejected
try(push_back(n, 5))
}
