Records and pattern matching (Closes #156) #165
Loading…
Reference in a new issue
No description provided.
Delete branch "156-records"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Language: defrecord registers a constructor + field accessors; match does record-shape destructuring, wildcards, and else clauses; records are a first-class value kind.
Engine: canonical loan (id amount term defaultn), bond and offer (price size turns-left) record types with builtin accessors (loan-id, loan-amount, loan-term, loan-default, bond-price/size/turns-left, offer-price/size/turns-left) and predicates (loan?, bond?, offer?). market-loans, market-bonds, and bank-offers now return records.
Brains: all five mains and the five spec brains migrated off nth indexing onto the accessors. bank-loans and bank-bond-assets/debts stay tuples until #158 defines the book shapes.
Verified: a full seeded spectate against master produces byte-identical output — the migration is behavior-preserving, and the magic-index class of bug is closed.