aboutsummaryrefslogtreecommitdiff
path: root/man/man3/tomo-Table.get_or_set.3
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-09-21 18:04:30 -0400
committerBruce Hill <bruce@bruce-hill.com>2025-09-21 18:04:30 -0400
commit0892ceda93fdc8f29baae3549b555d9519bfe523 (patch)
tree4c68658067059335c7ea02f19303db9b783d018e /man/man3/tomo-Table.get_or_set.3
parent68bedd3c23757a8576e77f38e38ddcf9ecd26d19 (diff)
Undo some changes
Diffstat (limited to 'man/man3/tomo-Table.get_or_set.3')
-rw-r--r--man/man3/tomo-Table.get_or_set.312
1 files changed, 6 insertions, 6 deletions
diff --git a/man/man3/tomo-Table.get_or_set.3 b/man/man3/tomo-Table.get_or_set.3
index 5361faf4..d607171a 100644
--- a/man/man3/tomo-Table.get_or_set.3
+++ b/man/man3/tomo-Table.get_or_set.3
@@ -2,14 +2,14 @@
.\" Copyright (c) 2025 Bruce Hill
.\" All rights reserved.
.\"
-.TH Table.get_or_set 3 2025-09-06 "Tomo man-pages"
+.TH Table.get_or_set 3 2025-05-17 "Tomo man-pages"
.SH NAME
Table.get_or_set \- get an item or set a default if absent
.SH LIBRARY
Tomo Standard Library
.SH SYNOPSIS
.nf
-.BI Table.get_or_set\ :\ func(t:\ &{K:V},\ key:\ K,\ default:\ V\ ->\ V?)
+.BI Table.get_or_set\ :\ func(t:\ &{K=V},\ key:\ K,\ default:\ V\ ->\ V?)
.fi
.SH DESCRIPTION
If the given key is in the table, return the associated value. Otherwise, insert the given default value into the table and return it.
@@ -22,7 +22,7 @@ allbox;
lb lb lbx lb
l l l l.
Name Type Description Default
-t &{K:V} The table. -
+t &{K=V} The table. -
key K The key whose associated value is to be retrieved. -
default V The default value to insert and return if the key is not present in the table. -
.TE
@@ -35,14 +35,14 @@ The default value is only evaluated if the key is missing.
.SH EXAMPLES
.EX
->> t := &{"A": @[1, 2, 3]; default=@[]}
+>> t := &{"A"=@[1, 2, 3]; default=@[]}
>> t.get_or_set("A").insert(4)
>> t.get_or_set("B").insert(99)
>> t
-= &{"A": @[1, 2, 3, 4], "B": @[99]}
+= &{"A"=@[1, 2, 3, 4], "B"=@[99]}
>> t.get_or_set("C", @[0, 0, 0])
= @[0, 0, 0]
>> t
-= &{"A": @[1, 2, 3, 4], "B": @[99], "C": @[0, 0, 0]}
+= &{"A"=@[1, 2, 3, 4], "B"=@[99], "C"=@[0, 0, 0]}
.EE