aboutsummaryrefslogtreecommitdiff
path: root/docs/serialization.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/serialization.md')
-rw-r--r--docs/serialization.md12
1 files changed, 7 insertions, 5 deletions
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
```