Skip to content

[codex] Document writer interpolation sugar - #46

Closed
bobzhang wants to merge 1 commit into
mainfrom
codex/document-writer-interpolation
Closed

[codex] Document writer interpolation sugar#46
bobzhang wants to merge 1 commit into
mainfrom
codex/document-writer-interpolation

Conversation

@bobzhang

Copy link
Copy Markdown
Contributor

Summary

  • Adds writer <+ "...\{x}" documentation near string interpolation.
  • Shows the StringBuilder usage in the existing interpolation example.
  • Documents that literal segments call write_string and interpolated expressions call write_object, not write.
  • Notes that String values use Show formatting under write_object, so they are quoted.

Validation

  • moon version -> moon 0.1.20260509 (8d0f1a5 2026-05-09)
  • moon run - with StringBuilder and <+ verified hello 42 output
  • moon run - with &Logger and <+ compiled successfully
  • custom writer with write_string + write_object compiled successfully
  • custom writer with write_string + write failed as expected: Type W has no method write_object
  • git diff --check

@bobzhang bobzhang closed this May 13, 2026
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