Skip to content

feat(printer): reader-macro sugar in Pr_data#124

Merged
jig merged 2 commits into
developfrom
feat/prdata-reader-sugar
Jul 21, 2026
Merged

feat(printer): reader-macro sugar in Pr_data#124
jig merged 2 commits into
developfrom
feat/prdata-reader-sugar

Conversation

@jig

@jig jig commented Jul 21, 2026

Copy link
Copy Markdown
Owner

Summary

Pr_data (the state-file serializer) now prints reader-macro expansions with their sugar instead of the underlying call:

value printed
(quote x) 'x
(quasiquote x) `x
(unquote x) ~x
(splice-unquote x) ~@x
(deref x) @x
(with-meta form meta) ^meta form

Width-aware wrapping still applies (a long '[...] wraps with the form aligned under the prefix), and the forms round-trip: the reader re-expands the sugar to the same value. Makes .state/ files read naturally.

Test plan

  • New TestPrDataReaderMacroSugar (all six macros + ordinary lists untouched + round-trip); updated the two existing Pr_data layout tests to the sugared output (one now exercises a '[...] that wraps).
  • Full suite green with and without -tags debugger.
  • E2E: a state value holding literal (quote …) / (deref …) forms serializes to '… / @… in .state/db.lisp and loads back correctly.

🤖 Generated with Claude Code

jig and others added 2 commits July 21, 2026 17:40
Pr_data now prints reader-macro expansions with their sugar instead of
the underlying call: (quote x)->'x, (quasiquote x)->`x, (unquote x)->~x,
(splice-unquote x)->~@x, (deref x)->@x, and (with-meta form meta)->
^meta form. Width-aware wrapping still applies (a long '[...] wraps with
the form aligned under the prefix), and the forms round-trip: the reader
re-expands the sugar to the same value.

This makes .state files (which serialize via Pr_data) read naturally.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@jig
jig merged commit 3130973 into develop Jul 21, 2026
14 checks passed
@jig
jig deleted the feat/prdata-reader-sugar branch July 21, 2026 15:45
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.

1 participant