diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-11-29 19:39:17 -0500 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-11-29 19:39:17 -0500 |
| commit | e2fa11b7fe35c6d7033e15725d08a09bd0f3c73a (patch) | |
| tree | 495ec5fa862b7415d88bec7291f734fa6a12ed37 /docs/serialization.md | |
| parent | 0d6ef67a014f231b4e24b71bb85ec1e4df5b6319 (diff) | |
Rename :serialize() -> :serialized()
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 6f0749ca..9ffb6050 100644 --- a/docs/serialization.md +++ b/docs/serialization.md @@ -10,12 +10,12 @@ original value. ## Serializing -To serialize data, simply call the method `:serialize()` 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:serialize() +>> serialized := value:serialized() = [0x0A] : [Byte] ``` @@ -30,7 +30,7 @@ is a placeholder, but it looks like this: ```tomo i := 123 -bytes := i:serialize() +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:serialize() +>> 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 |
