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

\item{value}{Element to prepend.}
}
\value{
Updated \code{flexseq}.
}
\description{
Returns a new sequence with \code{value} prepended at the left 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[2:4])
s2 <- push_front(s, "a")
s2
s  # unchanged

n <- as_flexseq(list(two = 2, three = 3))
new_el <- 1
names(new_el) <- "one"
push_front(n, new_el)

# Named/unnamed mixes are rejected
try(push_front(n, 0))
}
