(99 lines)
1 '\" t2 .\" Copyright (c) 2025 Bruce Hill3 .\" All rights reserved.4 .\"5 .TH Table 3 2025-11-29 "Tomo man-pages"6 .SH NAME7 Table \- a Tomo type8 .SH LIBRARY9 Tomo Standard Library10 .fi11 .SH METHODS13 .TP14 .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 .TP22 .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 .TP30 .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 .TP38 .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 .TP46 .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 .TP54 .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 .TP62 .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 .TP70 .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 .TP78 .BI Table.with\ :\ func(t:\ {K:V},\ other:\ {K:V}\ ->\ {K:V})79 Return a copy of a table with values added from another table81 For more, see:82 .BR Tomo-Table.with (3)85 .TP86 .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 .TP94 .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)