97. Auto-loaded Bitset for domain subset ops, struct array scalar-fill defaults, range-alias dims, [0..n]?T = read(none:), and ?T.map/.filter (2026-11-21)
- Decision.
- Add
("all", "Bitset")and("without", "Bitset")tocpl_check::prelude::BUILT_ON(skippingstdlib/paths to prevent stdlib cycles) so methods on values returned by prelude/domain members (for v in V.all.without(c)) work without importingstd.bitset.{Bitset}. - Allow scalar-fill broadcast (
array_fills) on struct field defaults and function parameter defaults (count: [Vol]Int = 0,delta: [0..=n + 1]Z = 0), resolveSym::AliasinLowerer::dimso range aliases (type Vol = 1..=5) work as array dimensions, and lower typedlet a: [0..n]?T = read(none: sentinel)throughSpec+reads_none_as. - Add
?T.map(f)and?T.filter(p)acrosscpl-checkandcpl-ir(accepting lambdas, functions, or arrays), lowering toDo/If/IsSome/Unwrap/Some/Nonewith zero new backend ops.
- Add
- Why. Mining the 39 under-4 dreams (
Dream: [1-3]/5) showed struct-field array defaults (cf2066e,cf2124f2), range-indexed sentinel reads (cf2129d), and?T.map/.filter(cf2124f2,wtf26d,cf2084g1,cf2084g2,cf2084h) were the top domain/type-system gaps, whileV.all.without(c)required an explicitBitsetimport even though the user never namedBitset. - Evidence.
proto/ports/ecnerwala/dream/cf2129d.cpandcf2084g1.cpnow passcpl checkwith 0 errors;cf2084g1port adoptsat[k + 1].map(...)and passesgate.sh cf2084g1 5;existential_compress.cpanddream_gaps.cppass differential interp + sanitized C++17 parity. - Reverse. Remove the two
BUILT_ONentries incrates/cpl-check/src/prelude.rs, revertarray_fillson defaults /Sym::AliasinLowerer::dim/read_none_argincrates/cpl-ir/src/lower/stmt.rs, and remove theTy::Optional"map" | "filter"arms incrates/cpl-check/src/check/call.rsandcrates/cpl-ir/src/lower/call.rs.