code / tomo

Lines41.3K C23.7K Markdown9.7K YAML5.0K Tomo2.3K
7 others 763
Python231 Shell230 make212 INI47 Text21 SVG16 Lua6
(99 lines)
1 '\" t
2 .\" Copyright (c) 2025 Bruce Hill
3 .\" All rights reserved.
4 .\"
5 .TH Table 3 2025-11-29 "Tomo man-pages"
6 .SH NAME
7 Table \- a Tomo type
8 .SH LIBRARY
9 Tomo Standard Library
10 .fi
11 .SH METHODS
13 .TP
14 .BI Table.clear\ :\ func(t:\ &{K:V}\ ->\ Void)
15 Removes all key-value pairs from the table.
17 For more, see:
18 .BR Tomo-Table.clear (3)
21 .TP
22 .BI Table.difference\ :\ func(t:\ {K:V},\ other:\ {K:V}\ ->\ {K:V})
23 Return a table whose key/value pairs correspond to keys only present in one table, but not the other.
25 For more, see:
26 .BR Tomo-Table.difference (3)
29 .TP
30 .BI Table.get\ :\ func(t:\ {K:V},\ key:\ K\ ->\ V?)
31 Retrieves the value associated with a key, or returns \fBnone\fR if the key is not present.
33 For more, see:
34 .BR Tomo-Table.get (3)
37 .TP
38 .BI Table.get_or_set\ :\ func(t:\ &{K:V},\ key:\ K,\ default:\ V\ ->\ V?)
39 If the given key is in the table, return the associated value. Otherwise, insert the given default value into the table and return it.
41 For more, see:
42 .BR Tomo-Table.get_or_set (3)
45 .TP
46 .BI Table.has\ :\ func(t:\ {K:V},\ key:\ K\ ->\ Bool)
47 Checks if the table contains a specified key.
49 For more, see:
50 .BR Tomo-Table.has (3)
53 .TP
54 .BI Table.intersection\ :\ func(t:\ {K:V},\ other:\ {K:V}\ ->\ {K:V})
55 Return a table with only the matching key/value pairs that are common to both tables.
57 For more, see:
58 .BR Tomo-Table.intersection (3)
61 .TP
62 .BI Table.remove\ :\ func(t:\ {K:V},\ key:\ K\ ->\ Void)
63 Removes the key-value pair associated with a specified key.
65 For more, see:
66 .BR Tomo-Table.remove (3)
69 .TP
70 .BI Table.set\ :\ func(t:\ {K:V},\ key:\ K,\ value:\ V\ ->\ Void)
71 Sets or updates the value associated with a specified key.
73 For more, see:
74 .BR Tomo-Table.set (3)
77 .TP
78 .BI Table.with\ :\ func(t:\ {K:V},\ other:\ {K:V}\ ->\ {K:V})
79 Return a copy of a table with values added from another table
81 For more, see:
82 .BR Tomo-Table.with (3)
85 .TP
86 .BI Table.with_fallback\ :\ func(t:\ {K:V},\ fallback:\ {K:V}?\ ->\ {K:V})
87 Return a copy of a table with a different fallback table.
89 For more, see:
90 .BR Tomo-Table.with_fallback (3)
93 .TP
94 .BI Table.without\ :\ func(t:\ {K:V},\ other:\ {K:V}\ ->\ {K:V})
95 Return a copy of a table, but without any of the exact key/value pairs found in the other table.
97 For more, see:
98 .BR Tomo-Table.without (3)