134. Field defaults and constrained string types (2026-11-21)
- Decision. Struct fields may have defaults (
steps: List<Int> = []), and a field writtentotal = 0takes its type from the default. A constructor call may omit defaulted fields.Str of "01?"is a string whose characters come from the literal's alphabet, which is a domain ([Alpha]Ttables, validation on read);Str(len: lo..=hi)bounds the length, checked on read like an integer range.varon a field, namedrecord, trailing lambdas,[read(...)]T,Mint(mod:)and lowercase variant patterns are rejected (spec/delta/parser-gaps.mdlists the replacements). - Why. Dreams kept reaching for these. Defaults remove constructor noise for accumulator records; alphabet and length constraints are statement facts that should be written once, like integer ranges.
- Reverse. Delete the forms; constructors pass every field.
- Status. Accepted in the spec; not parsed yet.