Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 40s
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
15 lines
661 B
Plaintext
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))))
|