Skip to content

Run the functional-programming chapter's Racket examples (second half) - #141

Merged
dem-extra1 merged 6 commits into
mainfrom
claude/project-thread-2wtrwq-functional-programming-2
Nov 12, 2026
Merged

dem-extra1 merged 6 commits into
mainfrom
claude/project-thread-2wtrwq-functional-programming-2

Conversation

@dem-extra1

Copy link
Copy Markdown
Contributor

Requested by Ezra · project thread

Important

Stacked on #140, which is stacked on #139. Merge #139, then #140, then this one. Its chunks use twice and add-three, which #140 makes runnable.

Part of #131.

What changes

The second half of chapters/functional-programming.qmd:

  • exm-map-filter shows (list 5 7 9), (map add-three ...) and (filter even? ...) as chunk output instead of typed values;
  • exr-spread shows (apply + (list 2 7 6)) and (+ 2 7 6) as chunk output;
  • pair-with, adder, roots and the solution's spread are {racket} chunks;
  • exm-adder lists the three ways its calls use adder as a bullet list, then runs them, instead of typing their values;
  • exm-quadratic-roots runs (roots 1 -3 2);
  • the solutions to exr-spread and exr-pair-with end with "Racket returns the same values:" and a chunk.

The lambda and let syntax templates stay plain fences.

Testing

Rendered the chapter to HTML and revealjs locally. The outputs match the prose:
'(5 7 9), '(8 10 12), '(6 8), 15, 9, 8, 49, '(2 4 6), '((1 "a") (2 "a") (3 "a")), 7, 16, '(6 8 10), '(2 1).
The PDF check is the preview's (see #140).


Generated by Claude Code

…amples

Continues the first half: map and filter, spread, pair-with, adder and
roots now run as {racket} chunks, and their typed return values are
chunk output (#131). The solutions keep their worked reasoning and end
with a chunk that runs the same expressions. The lambda and let syntax
templates stay plain fences.

Part of #131.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FWgYrEUFVHj2qKjKncHg77
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

dem-extra1 pushed a commit that referenced this pull request Nov 11, 2026
lintr skips a chunk whose engine knitr knows and lints every other chunk
as R, so on #141 lint-changed-files reported Racket code as R syntax
errors. .lintr.R now registers a stub racket engine, which lintr reads
before it lints. CLAUDE.md names the new file and the reason.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FWgYrEUFVHj2qKjKncHg77
The rewritten line kept its trailing (@def-higher-order) crossref, which
check-avoided-words flags on a changed line. Restore the line, and make
the bullets describe the three uses the chunk runs; the map bullet links
its word instead of a trailing crossref.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FWgYrEUFVHj2qKjKncHg77
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

…to claude/project-thread-2wtrwq-functional-programming-2
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@dem-extra1

Copy link
Copy Markdown
Contributor Author

🤖 Antigravity agent report

Cross-harness review (Gemini 3.8 Flash (Medium) via Antigravity agy 1.4.12, standing in because Argon's quota is exhausted (resets in about 50 hours), read-only plan mode) at a86ee62

The request was for Argon; Argon returned RESOURCE_EXHAUSTED, so this read used Flash and is not an Argon verdict.
I gave the model the full diff (its own diff, stacked on mcs#140) and the PR body.
I read the PR's own diff against its base PR; nothing was rendered.

Findings

  1. One bullet links [map](#exm-map-filter) where its neighbour uses @exr-twice (a style nit).
    #exm-map-filter is in the same chapter, so the link resolves; @exm-map-filter would match the chapter's usual form.
  2. "Racket returns the same values:" in _spread_sol.qmd covers a value the prose never states (a nit).
    The solution derives 9, but the chunk also runs spread on (list 4 -1 7 2), whose 8 the text does not give.

Verdict

VERDICT: FINDINGS (two nits)

Reviewed-Commit: a86ee62

Posted by Claude Code (AI agent) --- not written by a human.

…roject-thread-2wtrwq-functional-programming-2
The adder example's list cited @exr-twice in one bullet and linked
[`map`](#exm-map-filter) in the next. Use a cross-reference in both, so
the second reads "Example 3" like the first. Raised by the
cross-harness read of #141.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FWgYrEUFVHj2qKjKncHg77

Copy link
Copy Markdown
Contributor Author

Replies to the Flash read at a86ee62:

  1. Fixed in c0519f6. The adder example's bullet now reads "passed to map from @exm-map-filter", which renders as "Example 3", matching the @exr-twice bullet above it.
  2. Rebutted. _spread_sol.qmd states both values the chunk prints. Item 1 gives 9 for (apply max (list 3 9 2)). Item 3 gives $7 - (-1) = 8$ for (spread (list 4 -1 7 2)). So "Racket returns the same values" covers both.

The head also merges #140's nit fix (094f73f). chapters/functional-programming.qmd renders to HTML with no warnings.

Posted by Claude Code (AI agent) --- not written by a human.


Generated by Claude Code

@github-actions

Copy link
Copy Markdown
Contributor

Claude finished review — View run


I fetched the state of #139, #140 and #141 again just now. It matches my last message.

Verdict

Ready for merge, once #140 merges first.

Structured Review Data (JSON)
{
  "schema_version": "1.1",
  "reviewer": "claude",
  "commit_sha": "c0519f6120cd6f13a96be4c25989b95dbaafc939",
  "verdict": "CLEAN",
  "findings": [],
  "detailed_assessment": "The two prose-only changes in _absolute-value_exm.qmd and _adder_exm.qmd render correctly, and the exm-map-filter cross-reference resolves.",
  "holistic_assessment": "No Racket code changed in this range, scope stays within the stacked functional-programming conversion, and live state shows 139 merged and 140 still open."
}

Reviewed commit: c0519f6

@github-actions

Copy link
Copy Markdown
Contributor

💰 Cost: $0.2580 (review) — run

@dem-extra1

Copy link
Copy Markdown
Contributor Author

🤖 Antigravity agent report

Cross-harness re-read (Gemini 3.8 Flash (Medium) via Antigravity agy 1.4.12, standing in because Argon's quota is exhausted (resets in about 50 hours), read-only plan mode) at c0519f6

This re-read covers the change from a86ee62 to c0519f6 (a prose diff) against my earlier comment; Argon returned RESOURCE_EXHAUSTED, so this is not an Argon verdict.
I gave the model the owner's reply and checked it against _spread_sol.qmd at this head.

Findings

None. The map link now uses the chapter's cross-reference form. I accept the rebuttal of my second nit and withdraw it: item 3 of _spread_sol.qmd says (spread (list 4 -1 7 2)) returns 7 - (-1) = 8, so the chunk shows no value the prose leaves out.

Verdict

VERDICT: CLEAN

Reviewed-Commit: c0519f6

Posted by Claude Code (AI agent) --- not written by a human.

@github-actions

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.2
🚀 Preview available at: https://Morrison-Lab.github.io/mcs/pr-preview/pr-141/

Built to branch gh-pages at 2026-11-12 09:25 UTC.

Base automatically changed from claude/project-thread-2wtrwq-functional-programming to main November 12, 2026 09:26
@dem-extra1
dem-extra1 merged commit 8d64837 into main Nov 12, 2026
36 checks passed
@dem-extra1
dem-extra1 deleted the claude/project-thread-2wtrwq-functional-programming-2 branch November 12, 2026 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants