Skip to content

Concepts: ranges

Eugene Lazutkin edited this page Mar 10, 2026 · 6 revisions

Ranges in list-toolkit.

Concepts

Ranges represent a contiguous span of nodes — used for iteration, extraction, and removal.

A range is a plain object with:

  • from: the first node in the range
  • to: the last node in the range
  • list: the list that owns the range (optional)

Ranges are inclusive. Direction follows the nextName link from from to to.

Omitting from defaults to the list front; omitting to defaults to the list back. Both can be nodes or pointers.

Two types:

  • range (node range) — from and to are both nodes.
  • ptrRange (pointer range) — from is a Ptr (must have a valid previous node; see pointers), to is a node. Used with SLL only.

If from is missing in a ptrRange, most methods default to frontPtr. Note: ExtSList and ExtValueSList do not provide frontPtr.

Clone this wiki locally