From 97047cb95a88228ddefbc83b4c50b05eaf048272 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sat, 29 Nov 2025 15:56:02 -0500 Subject: Update docs --- docs/serialization.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'docs/serialization.md') diff --git a/docs/serialization.md b/docs/serialization.md index 287cbda7..8c72cb83 100644 --- a/docs/serialization.md +++ b/docs/serialization.md @@ -67,12 +67,14 @@ struct Cycle(name:Text, next:@Cycle?=none) c := @Cycle("A") c.next = @Cycle("B", next=c) ->> c +say("$c") +# @Cycle(name="A", next=@Cycle(name="B", next=@~1)) +bytes : [Byte] = c +say("$bytes") +# [0x02, 0x02, 0x41, 0x01, 0x04, 0x02, 0x42, 0x01, 0x02] +roundtrip : @Cycle = bytes +say("$roundtrip") # @Cycle(name="A", next=@Cycle(name="B", next=@~1)) ->> bytes : [Byte] = c -# [0x02, 0x02, 0x41, 0x01, 0x04, 0x02, 0x42, 0x01, 0x02] : [Byte] ->> roundtrip : @Cycle = bytes -# @Cycle(name="A", next=@Cycle(name="B", next=@~1)) : @Cycle assert roundtrip.next.next == roundtrip ``` -- cgit v1.2.3