Home

sequencefrom

SequenceFrom is a term used in programming to describe an operation that constructs a sequence starting from a given point or seed. The exact meaning varies by language and library, but it generally denotes generating a list or stream by applying a rule or selecting a portion of an existing sequence.

Common forms and signatures include several archetypes. One form creates an arithmetic or geometric progression from

Examples in pseudocode illustrate these ideas. A progression form might be sequenceFrom(start, step, n) returning [start,

Implementation considerations include lazy vs. eager evaluation and language support. In lazy contexts, sequenceFrom can produce

Related concepts include range and generator functions, iterators, and streaming pipelines. See also: sequence, range, generator,

a
start
value
with
a
step
or
ratio,
producing
a
fixed-length
sequence.
Another
form
selects
a
subsequence
from
an
existing
sequence,
starting
at
a
specified
index.
A
third
form
generates
an
infinite
or
lazily
evaluated
sequence
by
repeatedly
applying
a
function
to
a
current
value,
yielding
successive
elements
as
needed.
start+step,
...,
start+(n-1)step].
A
subsequence
form
could
be
sequenceFrom(sequence,
index)
returning
the
tail
starting
at
index.
An
iterative
form
uses
a
seed
and
a
generator
function:
sequenceFrom(seed,
f,
n)
producing
[seed,
f(seed),
f(f(seed)),
...,
n
elements].
infinite
sequences
without
computing
all
elements
up
front,
while
in
eager
contexts,
it
yields
a
finite
list
immediately.
Because
the
name
is
used
across
libraries
with
different
signatures,
consulting
specific
documentation
is
advisable
to
confirm
parameters
and
behavior.
and
tail.