docs(book): std io, path and console #826
No reviewers
Labels
No labels
loop
queue/failed
queue/queued
ready
status/parked
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
torbscript/language!826
Loading…
Reference in a new issue
No description provided.
Delete branch "loop/656-std-io-path-console"
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?
Closes #656
Adds the book pages
book/std/path.md,book/std/io.mdandbook/std/console.mdand lists them inbook/std/index.md. Written tobook/CONCEPT.md("How a page is written") in the shape ofbook/std/json.md: each page opens with what the module is for, then the tasks people use it for, each with a program.Old pages kept
docs/standard-library/io.md,path.mdandconsole.mdare not deleted. The skilltorbscript-standard-libraryis still built from all three (skills/torbscript-standard-library/references/standard-library/{io,path,console}.md, listed in itsSKILL.md), anddocs/standard-library/json.mdandfs.mdstayed for the same reason when their pages landed. They remain indocs/, unpublished (the site is built frombook/only). No skill changes, sodocs skill --checkis unaffected.What I could not verify
The pages were written without a local build; CI is the first run. The output blocks are derived by hand from
std/path/src/*.trb(everytrb runblock ofpath.mdand the print/Pathlines ofconsole.md), and the following are the places I am least sure of, so look there first ifdocs checkfails:path.md, last section: aPathfield in a user type encoding as its text and decoding back throughJson(), andFile.writeText/createDirectorytaking aPath(both stated in the std doc comments, not run by me).path.md:print(a ?? b)forms andprint(x == y)parse as intended;"\\"in a string is one backslash.console.md:print 1.5, "meters"prints1.5 meters;rows.joined(separator: "\n")over a lazymap(...).toList().io.md:standardOutput().addLine(...), thenprint, thenaddLinekeep their order in the captured output;buffered(capacity: 4096)followed byend()writes the three lines. Theconsoleblock underreadLineis not executed by the gate.readLine,lines, the prompt) is atrb checkblock on purpose, so CI never waits on stdin;printErrorandisTerminalaretrb checktoo, since stderr and terminal state are not part of the asserted output.Reviewer: @argus
CI findings on
ce1eecb(fixed in52109a1)docs check bookwas the only red gate intier A; it reported 7 problems, all addressed:console.md:print ["Ada", "Grace"]is indexing, nowprint(["Ada", "Grace"]).path.md: the word "usually" removed;Path.from(text),directory.joined(...)andSite(...)are command calls now, per the formatter canon.io.md(buffered(capacity: 4096)block): the native back end cannot build it (internal error: parameter 0 ofSink<Buffer<UInt8>, Failure>.addLineis typedObject(Sink<...>)but its place isShared(Buffered<...>)). That is a compiler gap, not a docs error, so the block is nowtrb checkwith aconsoleoutput block instead oftrb run; it can become arunblock once the back end builds it.CI red on
ce1eecb:ci / tier A (linux-x64)failed after 40m47s (soci / gatesfails); everything else is green or skipped, andtier Apasses on main (39m12s). The job log is not readable with the reviewer token, so I cannot name the failing block. Per the PR body, the unverifiedtrb runoutput blocks inbook/std/path.md,console.mdandio.mdare the likely place. Fix and push, and I will review the new head.CI red on
52109a1:ci / tier A (linux-x64)failed after 43m42s (soci / gatesfails); everything else is green or skipped. The job log is not readable with the reviewer token, so I cannot name the failing step. Not mergeable on52109a1: Forgejo reportsmergeable: false(base moved to692e148; likelybook/std/index.md), rebase and resolve. Fix and push, and I will review the new head.52109a19961332212eb7Rebased onto
main(692e148;book/std/index.mdconflict resolved by keeping Tasks and Parallel work, then Paths, Standard input and output, The console; the three pages now have orders 150/160/170 so the index order is unambiguous). The tier A failure on52109a1wasdocs check bookwith 3 problems, all fixed in this push:console.md:19: the list literal["Ada", "Grace"]insideprint(...)has no item type for the native back end; it is nowconst names: List<String> = [...]andprint names.console.md:21:3 + 4as a top-levelprintargument is now(3 + 4).io.md:94: thebufferedblock is refused natively on astablepage, so the page now carries the> **Not built natively yet.**note the check asks for (the block staystrb check).No local build (CI only); head
1332212, review re-requested from argus.CI red on
1332212:ci / tier A (linux-x64)failed after 43m54s (soci / gatesfails); everything else is green or skipped, and the PR is mergeable. The job log is not readable with the reviewer token, so I cannot name the failing step. Per the PR body,docs check bookis the gate that has failed on the earlier heads; thetrb runoutput blocks ofbook/std/path.md(hand-derived output) are the least verified. Fix and push, and I will review the new head.Read the tier A log of
1332212(job via the Actions API): the only red gate wasdocs check bookwith 4 problems left after the last push:console.md:21(the call with an operator argument is now written with parentheses:print("total:", 3 + 4, true)) andpath.md:139-141(cases in theSome(...)patterns are written without the dot:Some(Unix),Some(Drive(letter)),Some(Share(server, share))). Every other gate was green. Head274e6ee; no local build (CI only), review re-requested from argus.Approved on
274e6ee.ci / gatesandtier A (linux-x64)are green on this head, sodocs check book(it executes thetrb runblocks and compares theiroutputblocks), pdisc and the other gates pass. Skipped jobs are the usual non-docs ones.trb runblock is followed by itsoutputblock. Blocks that need stdin, stderr or a terminal, and thebufferedblock the native back end cannot build yet, aretrb check. Thebufferedlimitation is stated on the page.book/std/{path,io,console}.mdand the three index lines.docs/standard-library/{io,path,console}.mdare kept, with the reason (the skill is still built from them) in the PR body, as the issue allows.kind,status: stable,orderandpackage: std/*. The links go to existing pages (fs.md,io.md,console.md) and there is no INDEX.md in the diff.Non-blocking: none.
Post-merge check (merge commit
13d07c42on main): the PR has no 'After merge' section and no task in orion/tasks references it (the linked issue #656 is closed). Release: this repo cuts releases from v*.. tags (release.yml); the merged change is docs only and no release PR was cut in this run. Next step if a release is wanted: a version-bump PR, then tag. Nothing else is open on this PR.