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-listBoot-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
Examples:
(%as-list (Vector of 1 2 3)) => (1 2 3)%foldBoot-layer fold; the public face is (List fold).
Parameters:
CALLABLE — Binary function: (accumulator, element) -> new accumulatorANY — Initial accumulator valueLIST — List or iterable to fold overReturns: ANY — Final accumulated value
Examples:
(%fold (fn (_ acc x) (+ acc x)) 0 '(1 2 3)) => 6%lengthBoot-layer length; the public face is (List length).
Parameters:
LIST — List or iterableExamples:
(%length '(a b c)) => 3%appendBoot-layer append; the public face is (List append).
Examples:
(%append '(1 2) '(3) '(4 5)) => (1 2 3 4 5)%reverseBoot-layer reverse; the public face is (List reverse).
Parameters:
LIST — List or iterableExamples:
(%reverse '(1 2 3)) => (3 2 1)%mapBoot-layer map; the public face is (List map).
Parameters:
CALLABLE — Function to applyReturns: LIST — New list
Examples:
(%map (fn (_ x) (* x x)) '(1 2 3)) => (1 4 9)
(%map + '(1 2) '(10 20)) => (11 22)%filterBoot-layer filter; the public face is (List filter).
Parameters:
CALLABLE — Predicate functionLIST — List or iterableReturns: LIST — Filtered list
Examples:
(%filter (fn (_ x) (> x 1)) '(1 2 3)) => (2 3)%memq?Boot-layer eq? membership test.
Boot-layer eq? membership; the public face is (List includes?). Cross-base names need %member-str?.
Parameters:
ANY — Value to look for (eq? comparison)LIST — List to searchReturns: BOOL — True if x occurs in lst under eq?
Examples:
(%memq? 'b '(a b c)) => #t
(%memq? 'z '(a b c)) => #f%member-str?Boot-layer string membership test.
The str=? side of the membership split; convert cross-base symbols to strings and use this.
Parameters:
STRING — String to look for (str=? comparison)LIST — List of stringsReturns: BOOL — True if s occurs in lst under str=?
Examples:
(%member-str? "b" (list "a" "b")) => #t%findBoot-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:
CALLABLE — PredicateLIST — List to searchReturns: ANY — First element satisfying pred, or nil
Examples:
(%find (fn (_ x) (> x 1)) '(1 2 3)) => 2%for-eachBoot-layer for-each; the public face is (List for-each).
Parameters:
CALLABLE — Function to apply