Fix the mangled append-bool docstring - #8
Merged
Conversation
The docstring carried the UTF-8 bytes of the curly quotes around true and false as escaped octal (\342\200\234 / \342\200\235) behind a literal backslash-backslash, so the rendered docs read appends a bool as \342\200\234true\342\200\235 or \342\200\234false\342\200\235. Quote the two literals with backticks instead, which is what the rest of strbuf.carp and the org use for a literal inside a docstring, and which markdown renders as code. Docs regenerated with gendocs.carp.
There was a problem hiding this comment.
Build & Tests
carp -x --log-memory test/strbuf.carp — 20 passed, 0 failed, matching the PR. CI green on both legs.
Findings
None. Every claim in the description checks out:
- The rendered output is fixed.
docs/StringBuf.html:67now readsappends a bool as <code>true</code> or <code>false</code>. - The docs are reproducible. Re-ran
carp -x gendocs.carpon the branch andgit status --porcelaincame back empty — the committed HTML is exactly what the generator produces, not hand-edited. - The docstring is now accurate.
src/strbuf.h:92memcpys"true"/"false", andtest/strbuf.carp:112pins"yes=true no=false", sostrbuf.carp:56describes what the code does. - The history claim holds.
git show d66a50a:strbuf.carpcarries the double-backslash form at lines 56–57, exactly as described. - Nothing else is stale.
git grepfor the octal byte sequence over the whole tree returns no tracked file, and no rendered page has a remaining octal escape.docs/index.htmlanddocs/strbuf_index.htmlare still byte-identical (cmpclean) and carry no per-binder docstrings, so there really was nothing to sync there. - The one remaining
\\docstring,append-crlf, renders as a literal\r\natdocs/StringBuf.html:127. That is the intent there — it names the characters rather than emitting them — so leaving it alone was right.
Verdict: merge
Two lines, the rendered page is correct, and every supporting claim is verifiable.
hellerve
approved these changes
Aug 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What renders today
docs/StringBuf.htmlcurrently shows, verbatim:Those octal escapes are the UTF-8 bytes of the curly quotes that were meant to wrap
trueandfalse(E2 80 9C/E2 80 9D).strbuf.carp:56-57held them behind a literal backslash-backslash, so Carp unescaped\\342to a backslash followed by342rather than producing the character — the reader gets the byte notation, not a quote. It went in that way in d66a50a and has been rendering like that ever since.The fix
Backticks, not curly quotes. That is what the rest of
strbuf.carpalready does for a literal inside a docstring (the module doc backticksString.appendandStringBuf), and it is the org-wide convention —persistent,cairo,luaandrcall writeReturns `true` when …. Markdown turns it into<code>true</code>, so the rendered page now reads:which also matches what the C actually appends (
"true"/"false",src/strbuf.h:92).For the record,
carp-fmtis not the culprit: fed a raw“true”it round-trips the bytes untouched, so curly quotes would have been safe here. Backticks are the house style regardless, so that is what this uses.Docs
Regenerated with
carp -x gendocs.carp; the only change is the one line above.docs/index.htmlanddocs/strbuf_index.htmlare the module-list index — they carry no per-binder docstrings, are still byte-identical to each other, and gendocs left both untouched, so there is nothing to sync.No other docstring was touched.
Checks
carp -x --log-memory test/strbuf.carp— 20/20 passedangler(rebuilt from HEAD,185a9a2, so the new byte-offset rule is included) — cleancarp-fmt --check— cleanOpened by the carpentry-org heartbeat agent (Claude). Veit has not reviewed this yet.