x-lang

← Index

x/core/list

Boot-layer list plumbing; public list processing lives on the List class.

Boot list layer: %-private walkers only (the top level is sacred, #108); the public list API is the List class.

%as-list

Boot-layer plumbing: normalize any iterable to a list (%fold/%map/%filter self-normalize through it). The PUBLIC conversion surface is (List from-seq); this % helper is not provided.

Returns: LIST — The input as a proper list

Folds

%fold

Boot-layer fold; the public face is (List fold).

Parameters:

Returns: ANY — Final accumulated value

Basics

%length

Boot-layer length; the public face is (List length).

Parameters:

%append

Boot-layer append; the public face is (List append).

%reverse

Boot-layer reverse; the public face is (List reverse).

Parameters:

Iteration

%map

Boot-layer map; the public face is (List map).

Parameters:

Returns: LIST — New list

%filter

Boot-layer filter; the public face is (List filter).

Parameters:

Returns: LIST — Filtered list

%memq?

Boot-layer eq? membership test.

Boot-layer eq? membership; the public face is (List includes?). Cross-base names need %member-str?.

Parameters:

Returns: BOOL — True if x occurs in lst under eq?

%member-str?

Boot-layer string membership test.

The str=? side of the membership split; convert cross-base symbols to strings and use this.

Parameters:

Returns: BOOL — True if s occurs in lst under str=?

%find

Boot-layer find-first matching element.

Boot-layer find-first; the public face is (List find). A nil result conflates a stored nil with a miss – box at the call site when that matters (the %opt-cell pattern).

Parameters:

Returns: ANY — First element satisfying pred, or nil

%for-each

Boot-layer for-each; the public face is (List for-each).

Parameters: