diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-11-29 15:56:02 -0500 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-11-29 15:56:02 -0500 |
| commit | 97047cb95a88228ddefbc83b4c50b05eaf048272 (patch) | |
| tree | fb6a57ef6c6fd8e18aba8b8c3e3c6bbf83d61ec6 /docs/serialization.md | |
| parent | d60962ab5de970a9ce0893df4154b8a0b3ea646a (diff) | |
Update docs
Diffstat (limited to 'docs/serialization.md')
| -rw-r--r-- | docs/serialization.md | 12 |
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 ``` |
