Files
rose-ash/lib/content/wire.sx
giles 90136f3a99
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 40s
content: on-the-wire serialization (wire.sx) + 11 tests (534/534)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-07 03:18:09 +00:00

15 lines
661 B
Plaintext

;; content-on-sx — on-the-wire serialization.
;;
;; content/to-wire serialises a document to a transmittable SX-text string (via
;; the data form + the SX serializer); content/from-wire parses it back into a
;; live document. This is the format to persist a whole document or send it over
;; HTTP / federation, distinct from the per-op persist log.
;;
;; Requires (loaded by harness): data.sx (content/to-data / content/from-data).
(define content/to-wire (fn (doc) (serialize (content/to-data doc))))
(define content/from-wire (fn (s) (content/from-data (parse s))))
(define
content/wire-round-trip
(fn (doc) (content/from-wire (content/to-wire doc))))