From 2bb2ff871fa1761478442bec5f6a32c9428360a1 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sun, 6 Apr 2025 14:20:18 -0400 Subject: Change method calls to use `foo.baz()` instead of `foo:baz()` --- docs/serialization.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'docs/serialization.md') diff --git a/docs/serialization.md b/docs/serialization.md index a1a38fdb..d63cb168 100644 --- a/docs/serialization.md +++ b/docs/serialization.md @@ -10,12 +10,12 @@ original value. ## Serializing -To serialize data, simply call the method `:serialized()` on any value and it +To serialize data, simply call the method `.serialized()` on any value and it will return an array of bytes that encode the value's data: ```tomo value := Int64(5) ->> serialized := value:serialized() +>> serialized := value.serialized() = [0x0A] : [Byte] ``` @@ -30,7 +30,7 @@ To deserialize data, you must provide its type explicitly using the syntax ```tomo i := 123 -bytes := i:serialized() +bytes := i.serialized() roundtripped := deserialize(bytes -> Int) >> roundtripped @@ -58,7 +58,7 @@ c := @Cycle("A") c.next = @Cycle("B", next=c) >> c = @Cycle(name="A", next=@Cycle(name="B", next=@~1)) ->> serialized := c:serialized() +>> serialized := c.serialized() = [0x02, 0x02, 0x41, 0x01, 0x04, 0x02, 0x42, 0x01, 0x02] : [Byte] >> roundtrip := DESERIALIZE(serialized):@Cycle = @Cycle(name="A", next=@Cycle(name="B", next=@~1)) : @Cycle -- cgit v1.2.3