A map stores key-value pairs. It is comparable to an associative array in PHP or a dictionary in several other languages. Keys identify values and do not need to be sequential numbers.
Creating maps
$scores = [ "Jamie" => 92, "Jack" => 84 ] $empty_map = [=>]
The fat arrow separates each key from its value. Use [=>] when
an explicitly typed empty map is required.
Accessing values
print($scores["Jamie"]) $scores["Joseph"] = 88
Filtering, selecting and ordering
Map predicates and selectors receive the key followed by the value.
where(function predicate) ⇒ map- Returns the original pairs for which the predicate returns true.
select(function projection) ⇒ list- Projects each key-value pair into a value in a new list.
order_by(function key_selector) ⇒ ordered map- Returns the original pairs ordered by the selected value.
$passed = $scores->where($name, $score => $score >= 50) $names = $passed->select($name, $score => $name) $ranked = $passed->order_by($name, $score => $score)
select and order_by were made available in ZPE 1.14.9
(Spurriergate, September 2026).
Legacy behaviour
Before ZPE 1.9.9, map functions used the
associative_array_ prefix. The shorter map_ names are
the current names; older aliases remain relevant when reading historical code.
Before ZPE 1.5.3, associative arrays used braces rather than square brackets. This changed the source syntax without changing the underlying map concept.

There are no comments on this page.
Comments are welcome and encouraged, including disagreement and critique. However, this is not a space for abuse. Disagreement is welcome; personal attacks, harassment, or hate will be removed instantly. This site reflects personal opinions, not universal truths. If you can’t distinguish between the two, this probably isn’t the place for you. The system temporarily stores IP addresses and browser user agents for the purposes of spam prevention, moderation, and safeguarding. This data is automatically removed after fourteen days. Your email address is stored so that replies can be sent to your email address.
Comments powered by BalfComment