aboutsummaryrefslogtreecommitdiff
path: root/man/man3/tomo-Table.difference.3
blob: 999f0e55f62cf700280f2935ed4bf81b409a5fbf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
'\" t
.\" Copyright (c) 2025 Bruce Hill
.\" All rights reserved.
.\"
.TH Table.difference 3 2025-11-29 "Tomo man-pages"
.SH NAME
Table.difference \- return a table using keys not present in both tables
.SH LIBRARY
Tomo Standard Library
.SH SYNOPSIS
.nf
.BI Table.difference\ :\ func(t:\ {K:V},\ other:\ {K:V}\ ->\ {K:V})
.fi
.SH DESCRIPTION
Return a table whose key/value pairs correspond to keys only present in one table, but not the other.


.SH ARGUMENTS

.TS
allbox;
lb lb lbx lb
l l l l.
Name	Type	Description	Default
t	{K:V}	The base table. 	-
other	{K:V}	The other table. 	-
.TE
.SH RETURN
A table containing the common key/value pairs whose keys only appear in one table.

.SH EXAMPLES
.EX
t1 := {"A": 1; "B": 2, "C": 3}
t2 := {"B": 2, "C":30, "D": 40}
assert t1.difference(t2) == {"A": 1, "D": 40}
.EE
.SH SEE ALSO
.BR Tomo-Table (3)