diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-04-06 14:20:18 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-04-06 14:20:18 -0400 |
| commit | 2bb2ff871fa1761478442bec5f6a32c9428360a1 (patch) | |
| tree | 9b73df7a0c50c02353ae7bca7c2cd54788ef0077 /docs/serialization.md | |
| parent | 59845e610f2c90474f34079d27b5f1e07071ded4 (diff) | |
Change method calls to use `foo.baz()` instead of `foo:baz()`
Diffstat (limited to 'docs/serialization.md')
| -rw-r--r-- | docs/serialization.md | 8 |
1 files changed, 4 insertions, 4 deletions
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 |
