Skip to content

Add C-style macro preprocessor for unit programs - #46

Open
aburston wants to merge 5 commits into
masterfrom
ccr-ab4868e2-ax1gla
Open

aburston wants to merge 5 commits into
masterfrom
ccr-ab4868e2-ax1gla

Conversation

@aburston

Copy link
Copy Markdown
Owner

Unit programming gets a c style preprocessor.

Planning artifacts only: proposal, delta specs (program-preprocessor,
unit-program, default-army, web-interface), design and tasks.

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

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CfYiehKYL7qwh1zNnCvrW1
…aults

A program's text is expanded before it is checked, priced and run:
#define (object- and function-like), #undef, #ifdef/#ifndef/#else/#endif,
#error, ## pasting and #include of the one built-in header, <unit.h>, which
names the directions, the map's answers, every sensor's registers and a
handful of one-for-one helpers. A \ continuation gives one line per body
line, @labels are private to each use, and every refusal, listing and
trace names the source line (and the macro it came through). Macros cost
nothing; a line costs what it expands to.

The hunter, explorer, vanguard and warden are rewritten with the header,
named registers and named subroutines so that they read as a description
of what the unit does. Doctrine tests pin each program on hand-built
boards; the stock game they play is identical, turn for turn, to the one
the old programs played, and five arena games (281-285) are written up in
matches/RESULTS-READABLE-PROGRAMS.md.

Listings (CLI, API, armoury) show a macro line's expansion beneath it;
the tariff publishes the headers; the guide gains a Macros chapter whose
examples are parsed by a test.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CfYiehKYL7qwh1zNnCvrW1
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CfYiehKYL7qwh1zNnCvrW1
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