Skip to content

Add a week 1 chapter on functional programming in Racket, and the ABCD card - #38

Merged
d-morrison merged 2 commits into
mainfrom
claude/project-thread-fi3mve
Oct 29, 2026
Merged

d-morrison merged 2 commits into
mainfrom
claude/project-thread-fi3mve

Conversation

@d-morrison

Copy link
Copy Markdown
Contributor

Requested by Ezra · project thread

Note

This PR is over the 10-file / 300-line size cap, because it adds one whole chapter (one subfile per div), as for the earlier chapter PRs.

Why

The syllabus lists "Introduction to functional programming" in week 1, and one of the course outcomes is about functional style. The notes use Racket from the predicates chapter onward, but no chapter introduced it and the calendar gave it no day. So the only Racket introduction students had was Lab 1, which is private and comes on Thursday or Friday. The syllabus also promised a printable ABCD card, but its PDF link still said TBD.

What

  • chapters/functional-programming.qmd, with its units in chapters/_subfiles/functional-programming/. It has five sections: expressions and how Racket evaluates them, defining and applying functions by substitution, if and cond, pure functions and side effects, and higher-order functions with map and filter.
    • It includes the mds definitions of function, expression, argument and value. Before, nothing here defined def-function, so the relations chapter's @def-function went to the mds site. It now resolves to this week 1 page.
    • The examples avoid Lab 1's tasks and expressions, and the matching mcsg worksheet's items.
  • The calendar and the syllabus schedule put the chapter on Wednesday, January 6, between the syllabus and propositional logic. It is also added to the navbar and sidebar, after the syllabus.
  • images/abcd-card.py draws images/abcd-card.pdf: a landscape page in four Okabe-Ito colors with large letters and fold lines, so it also works printed in black and white. The output is byte-for-byte reproducible. The syllabus links it, and .gitignore lets this one PDF be tracked.
  • references.bib gets three Wikipedia entries: functional programming, pure function, and higher-order function.

Checks

  • Rendered locally to HTML: the chapter, the calendar and the syllabus. check-rendered-page.py is clean on all three. .github/scripts/check-unresolvable-refs.py is clean on the chapter. _site/images/abcd-card.pdf is copied.
  • There is no TeX in this session, so the PDF handout needs a look on the preview.
  • An adversarial review of the first draft found 14 issues. The second commit fixes them, for example one step per line in the evaluation examples, a note that if and cond are not applications, and a forward link from the included mds definition of expression.

Worksheet 0 (private, in mcsg) goes with this chapter.


Generated by Claude Code

The syllabus lists an introduction to functional programming in week 1,
and the notes use Racket from the predicates chapter on,
but no chapter introduced it and the calendar gave it no day.
Lab 1 was the only introduction, and students cannot read it until the lab.

The new chapter covers Racket expressions in prefix notation and how
they are evaluated, defining and applying functions by substitution,
if and cond, pure functions and side effects, and higher-order functions
with map and filter. It includes the mds definitions of expression,
function, argument and value, so relations' @def-function now resolves
here instead of on the mds site. Its examples avoid Lab 1's tasks.
The calendar and syllabus put it on Wednesday of week 1, with the
syllabus and propositional logic, and it joins the navbar and sidebar.

The syllabus promised a printable ABCD card but had a TBD for its PDF.
images/abcd-card.py draws it (Okabe-Ito colors, large letters, fold
lines), and .gitignore lets that one PDF be tracked.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019xfc9qa8iKsjjEyuh6bV3w
Show one step per line in the evaluation examples, as the text claims;
say that if, cond, and, or and define are not applications; call define
a definition; move the mds definition of function ahead of the
definition of expression that links it; split side effect into its own
definition; use \abs; change the map and filter example's list so it is
not one of Lab 1's expressions; and name the expressions the next_id
remark compares.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019xfc9qa8iKsjjEyuh6bV3w
Copilot AI balanced review requested due to automatic review settings October 29, 2026 08:08

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

@d-morrison d-morrison self-assigned this Oct 29, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Claude finished review — View run


No R files touched. I've completed a thorough review covering content correctness, cross-references, build hygiene, bibliography, link validity, and style conventions. Everything checks out clean.

Review: PR #38 — Add a week 1 chapter on functional programming in Racket, and the ABCD card

Scope. Adds chapters/functional-programming.qmd (new chapter, 142 lines) with 25 subfiles in chapters/_subfiles/functional-programming/, wires it into the navbar/sidebar/calendar/syllabus, draws images/abcd-card.pdf via a new images/abcd-card.py, and adds three Wikipedia references.bib entries. This is a content-only, prose-heavy PR with one small Python helper script — no R or workflow changes.

What I verified:

  • Cross-references: every @def-/@exr-/@exm-/@rem-/@sol- citation in the new chapter and its subfiles resolves to a defined id (checked check-unresolvable-refs.py chapters/functional-programming.qmd → clean). The mds includes (_def-function.qmd, _def-expression.qmd, _def-argument.qmd, _def-value.qmd) all exist at the referenced paths, and _def-function.qmd is included on exactly one page, so there's no cross-page id collision for @def-function.
  • Math/code correctness: hand-checked every Racket evaluation and formula in the new subfiles (_evaluate-nested, _formula-from-code, _substitution, _ticket-price, _twice, _map-filter, _next-id, _absolute-value) — all arithmetic and Racket semantics are correct (including the h(h(3)) = 3 fixed-point case and the next_id() impurity example).
  • ABCD-card script: ran images/abcd-card.py and byte-for-byte diffed the output against the committed images/abcd-card.pdf — identical, confirming the PR's reproducibility claim. Script style matches the existing images/*-figures.py / venn-letters.py conventions (docstring + usage line, matplotlib.use("Agg"), out = sys.argv[1]).
  • .gitignore: the new !images/abcd-card.pdf negation correctly un-ignores just that one file (git check-ignore confirms it's tracked, while *.pdf still blocks others).
  • Bibliography: the three new @misc{wikipedia_...} entries match the exact format of existing Wikipedia entries in this file and in mds/references.bib; no duplicate citation keys; all three URLs return HTTP 200.
  • Links: https://racket-lang.org/ and https://docs.racket-lang.org/guide/ both resolve; neither needs a lychee.toml exception.
  • Spell-check: Racket, DrRacket, and ABCD are already in inst/WORDLIST.
  • Table formatting: the edited calendar.qmd grid-table rows are still exactly 152 characters wide and properly padded (grid tables are whitespace-sensitive); the syllabus.qmd edit is in a pipe table, where cell width doesn't matter.
  • Style conventions: the new chapter's YAML header, {{< include ../latex-macros/macros.qmd >}}, and collapsible "Source" callout all match the pattern used by other chapters (e.g. contrapositive-contradiction.qmd); attribution to "Kameron Decker Harris's Fall 2026 syllabus" is a real, consistently-used name elsewhere in the repo, not fabricated.
  • Hallucination check: the PR description's check-rendered-page.py isn't in this repo, but it is a real script bundled with the Morrison-Lab/ai-config plugin (scripts/check-rendered-page.py) used for local rendered-output checks — not a fabricated tool.
  • Navbar/sidebar/calendar/syllabus additions are consistently ordered (after Syllabus, before Propositional Logic) in all four places.

No blocking issues found. This is a clean, well-tested, convention-following PR — content was mathematically verified, the one piece of executable code was run and its reproducibility claim confirmed, and every cross-reference, link, and bibliography entry checks out.

Verdict

Ready for merge

Structured Review Data (JSON)
{
  "schema_version": "1.1",
  "reviewer": "claude",
  "commit_sha": "4380d393a2a81bb99bfac33531e56fefaed54a3d",
  "verdict": "CLEAN",
  "findings": [],
  "detailed_assessment": "Ran images/abcd-card.py and byte-diffed its output against the committed PDF, hand-verified every Racket evaluation example in chapters/_subfiles/functional-programming/, and confirmed check-unresolvable-refs.py reports zero broken crossrefs in chapters/functional-programming.qmd.",
  "holistic_assessment": "Navbar, sidebar, calendar, and syllabus integration are consistently ordered, the new references.bib entries and their URLs validate, and no R, workflow, or build-artifact files were touched, so regression risk and scope creep are both minimal."
}

Reviewed commit: 4380d39

@github-actions

Copy link
Copy Markdown
Contributor

💰 Cost: $1.2943 (review) — run

@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1
Preview removed because the pull request was closed.

2026-10-29 15:04 UTC

Copy link
Copy Markdown
Contributor Author

I checked the preview's handout PDF at head 4380d39 (pr-preview/pr-38/chapters/functional-programming-handout.pdf on gh-pages).

  • It has 9 pages. I viewed every page, and every definition, exercise, solution and example renders in its box.
  • The \abs display, the piecewise p(a), and the Racket code blocks all render correctly.
  • The extracted text has no ??, no ?@ and no raw macros.
  • The only layout issue is the existing one in PDF handouts break callout boxes across pages #6: boxes are never split across pages, which leaves white space at the foot of pages 1 to 4.

images/abcd-card.pdf is published at pr-preview/pr-38/images/abcd-card.pdf.

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


Generated by Claude Code

@d-morrison
d-morrison merged commit c9da157 into main Oct 29, 2026
28 checks passed
@d-morrison
d-morrison deleted the claude/project-thread-fi3mve branch October 29, 2026 15:04

Copy link
Copy Markdown
Contributor Author

Merged under Ezra's mwc grant, given in the project thread at 08:02 PDT on 2026-10-29. At merge time, check-pr-fully-clean.py reported FULLY CLEAN on the head, all CI checks had passed, and the Claude review was clean.

The cross-model review was waived because no reviewer from another model or harness could run from this cloud session. opencode.ai returned 429 for all eight *-free models and 400 or 403 for the others. This session has no other reviewer CLI or credential.

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


Generated by Claude Code

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.

3 participants