Summary
Add a focused list/array helper library that follows Base's in-place/result-variable API style.
Rationale
aks/bash-lib has useful list and hash utility coverage. Base should borrow the idea for array ergonomics, but keep the initial scope narrow and aligned with the current string-library direction: no subshell-heavy output capture for mutations, validated variable names, and clear import guardrails.
Proposed Scope
- Add a new guarded companion library, likely
lib/bash/list/lib_list.sh.
- Require
lib_std.sh to be sourced first.
- Provide a small initial API for array/list operations such as membership, append/prepend, remove, unique/dedupe, join/split interop, and length checks.
- Use result-variable or in-place named-variable APIs for operations that need to modify caller state.
- Add README coverage and examples.
- Add BATS coverage for whitespace-preserving values, empty elements, invalid variable names, and repeated sourcing.
Acceptance Criteria
- The library improves common Bash array handling without becoming a broad data-structure framework.
- Mutating helpers avoid command-substitution/subshell patterns.
- Public helpers validate variable-name inputs with
assert_variable_name.
./tests/validate.sh passes.
Notes
Concept source: comparison with aks/bash-lib list utilities; write fresh Base-style code.
Summary
Add a focused list/array helper library that follows Base's in-place/result-variable API style.
Rationale
aks/bash-libhas useful list and hash utility coverage. Base should borrow the idea for array ergonomics, but keep the initial scope narrow and aligned with the current string-library direction: no subshell-heavy output capture for mutations, validated variable names, and clear import guardrails.Proposed Scope
lib/bash/list/lib_list.sh.lib_std.shto be sourced first.Acceptance Criteria
assert_variable_name../tests/validate.shpasses.Notes
Concept source: comparison with
aks/bash-liblist utilities; write fresh Base-style code.