docs(book): std collections #675
Loading…
Reference in a new issue
No description provided.
Delete branch "loop/641-std-collections"
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?
Adds the Std page
book/std/collections.md(package: std/collections), written likebook/std/json.md, and regenerates the generated block ofbook/std/index.md.What the page covers
Counting with a map (
updatewith a fallback), lists as values (varmarks a change, theappend/appendedtwins, with thetrb errorfor aconstlist), reading without a panic (get,part,first,indexOf, andget(key) ?? 0on a map), cutting (windows,chunks,splitAt,slice), changing elements in place (for var,update), sets (Set.from,union/intersection/difference), stacks and queues,Heap, one signature with any implementation (RingList,HashMap), andFlags.Old page
docs/standard-library/collections.mdstays indocs/, unpublished (the site is built frombook/only), likejson.md,fs.mdand the other first-slice pages: the Agent Skilltorbscript-standard-libraryis generated from it (skills/torbscript-standard-library/references/standard-library/collections.mdand its index line) and needs the complete declarations, which the short book page deliberately leaves to the generated reference. Deleting it would remove a reference from the skill. Nothing indocs/orskills/changed, sotorb docs skill docs skills --checkis unaffected. No other book page changes.Test
Every
trb runandtrb errorblock was run with thetorbnightly 20261029 and its output compared with theoutputblock (all 13 match; fortrb errorfromerror:on, astorb check main.trbprints it). Run locally with that nightly:torb docs index book --check(up to date),torb docs site book --check --no-native(no broken link),torb docs skill docs skills --check(up to date). The book rules oftorb docs check book(banned words, no issue numbers, list length, output blocks) exist only in the CI build of the checker, so they were checked by hand;torb docs check bookandtools/gates.shrun in CI.The
order:is 70; the sibling pages in review use 50 and 60.Closes #641
CI red on
6a384ae: ci / tier A (linux-x64) →docs check book(thegatescheck follows from it). Cause, from the job log:book/std/collections.md:125and:222:printhas an operator at the top level of an argument, so it is written with parentheses.book/std/collections.md:319: a call is a command wherever the grammar allows it; writerecent.removeAt ...without parentheses.Also not mergeable on
6a384ae: rebase onto main (d307c11); no other blockers seen so far (full review follows once CI is green on the rebased head).6a384aef8e2001e5af77Not mergeable on
2001e5a: rebase onto main (c4cac72; likely a conflict inbook/std/index.md); no other blockers. CI is green on this head; the rebase run brings the review back.2001e5af77663cbe0828Approved at
663cbe0.book/std/collections.mdand the generated line inbook/std/index.md; no other book page touched.docs/standard-library/collections.mdunpublished is justified in the body (the skill is generated from it), consistent with json/fs.json.md,package: std/collections, no links, no issue numbers; index block regenerated, pdisc green.Non-blocking: none.