Skip to content

docs: Add an environment diagram style guide - #75

Merged
StoneyJackson merged 1 commit into
mainfrom
docs/environment-diagram-guide
Nov 5, 2026
Merged

StoneyJackson merged 1 commit into
mainfrom
docs/environment-diagram-guide

Conversation

@StoneyJackson

Copy link
Copy Markdown
Member

Add a guide for textbook authors drawing environment diagrams in PlantUML, with worked examples for V3, V4, V5, SET, REF, NAME, and NEED. Point to it from the general style guide.

Add a guide for textbook authors drawing environment diagrams in
PlantUML, with worked examples for V3, V4, V5, SET, REF, NAME, and NEED.
Point to it from the general style guide.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 5, 2026 01:20
@StoneyJackson
StoneyJackson merged commit e98c288 into main Nov 5, 2026
2 of 3 checks passed

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.

🟡 Changes recommended

The style-guide rule needs a ThunkRef exception to distinguish NAME’s per-access evaluation from NEED’s memoization and avoid incorrectly depicting separate results as one shared value.

1 open issue
What changed in this PR

Adds guidance for textbook authors to create consistent PlantUML environment diagrams, with worked examples covering scope, references, and parameter passing.

Changes:

  • Defines conventions for diagram structure, naming, arrows, evaluation markers, and layout adjustments.
  • Adds examples for V3, V4, V5, SET, REF, NAME, and NEED.
  • Points authors to the new documentation from the general style guide.
File Description
style-guide.md Adds a pointer to the environment diagram guide.
docs/​environment-diagrams/​style-guide.md Defines diagram conventions and PlantUML guidance.
docs/​environment-diagrams/​diagrams-v5.md Illustrates recursive bindings and closure calls.
docs/​environment-diagrams/​diagrams-v4.md Illustrates lexical scope and captured environments.
docs/​environment-diagrams/​diagrams-v3.md Shows nested bindings and variable shadowing.
docs/​environment-diagrams/​diagrams-set.md Shows mutation, parameter references, and persistent captured state.
docs/​environment-diagrams/​diagrams-ref.md Contrasts variable and expression arguments under call-by-reference.
docs/​environment-diagrams/​diagrams-need.md Shows thunk memoization and read-only argument references.
docs/​environment-diagrams/​diagrams-name.md Shows argument references and deferred evaluation under call-by-name.

Review effort: Balanced

| `proc` | A new `ProcVal`, or *closure*, whose `env` points to the environment where the `proc` was evaluated |
| A function call | A new environment extending the closure's `env`, not the caller's |
| Primitive such as `+` or `add1` | A new `IntVal` |
| A variable used as a value | The same value object the variable is bound to, not a copy |
@StoneyJackson
StoneyJackson deleted the docs/environment-diagram-guide branch November 5, 2026 01:36
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