diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-06-24 13:37:09 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-06-24 13:37:09 -0400 |
| commit | 271017ba9970e4220e1bd0dc83ce146afe9222a2 (patch) | |
| tree | 995233d21141f164aa5f9e1d9b7bab757124e622 /man | |
| parent | e122e5525ef044c25c2cd888bc267f7a2bd91b4f (diff) | |
Add Path.has_extension() and update manpages/api docs
Diffstat (limited to 'man')
| -rw-r--r-- | man/man3/tomo-Path.has_extension.3 | 41 | ||||
| -rw-r--r-- | man/man3/tomo-Table.with_fallback.3 | 40 | ||||
| -rw-r--r-- | man/man3/tomo-Table.xor.3 | 35 |
3 files changed, 116 insertions, 0 deletions
diff --git a/man/man3/tomo-Path.has_extension.3 b/man/man3/tomo-Path.has_extension.3 new file mode 100644 index 00000000..4556c819 --- /dev/null +++ b/man/man3/tomo-Path.has_extension.3 @@ -0,0 +1,41 @@ +'\" t +.\" Copyright (c) 2025 Bruce Hill +.\" All rights reserved. +.\" +.TH Path.has_extension 3 2025-06-24 "Tomo man-pages" +.SH NAME +Path.has_extension \- check if a path has a given extension +.SH LIBRARY +Tomo Standard Library +.SH SYNOPSIS +.nf +.BI Path.has_extension\ :\ func(path:\ Path,\ extension:\ Text\ ->\ Bool) +.fi +.SH DESCRIPTION +Return whether or not a path has a given file extension. + + +.SH ARGUMENTS + +.TS +allbox; +lb lb lbx lb +l l l l. +Name Type Description Default +path Path A path. - +extension Text A file extension (leading `.` is optional). If empty, the check will test if the file does not have any file extension. - +.TE +.SH RETURN +Whether or not the path has the given extension. + +.SH EXAMPLES +.EX +>> (/foo.txt).has_extension("txt") += yes +>> (/foo.txt).has_extension(".txt") += yes +>> (/foo.tar.gz).has_extension("gz") += yes +>> (/foo.tar.gz).has_extension("zip") += no +.EE diff --git a/man/man3/tomo-Table.with_fallback.3 b/man/man3/tomo-Table.with_fallback.3 new file mode 100644 index 00000000..89c78fe1 --- /dev/null +++ b/man/man3/tomo-Table.with_fallback.3 @@ -0,0 +1,40 @@ +'\" t +.\" Copyright (c) 2025 Bruce Hill +.\" All rights reserved. +.\" +.TH Table.with_fallback 3 2025-06-24 "Tomo man-pages" +.SH NAME +Table.with_fallback \- return a table with a new fallback +.SH LIBRARY +Tomo Standard Library +.SH SYNOPSIS +.nf +.BI Table.with_fallback\ :\ func(t:\ {K=V},\ fallback:\ {K=V}?\ ->\ {K=V}) +.fi +.SH DESCRIPTION +Return a copy of a table with a different fallback table. + + +.SH ARGUMENTS + +.TS +allbox; +lb lb lbx lb +l l l l. +Name Type Description Default +t {K=V} The table whose fallback will be replaced. - +fallback {K=V}? The new fallback table value. - +.TE +.SH RETURN +The original table with a different fallback. + +.SH EXAMPLES +.EX +t := {"A"=1; fallback={"B"=2}} +t2 = t.with_fallback({"B"=3"}) +>> t2["B"] += 3? +t3 = t.with_fallback(none) +>> t2["B"] += none +.EE diff --git a/man/man3/tomo-Table.xor.3 b/man/man3/tomo-Table.xor.3 new file mode 100644 index 00000000..8d3cb8f2 --- /dev/null +++ b/man/man3/tomo-Table.xor.3 @@ -0,0 +1,35 @@ +'\" t +.\" Copyright (c) 2025 Bruce Hill +.\" All rights reserved. +.\" +.TH Table.xor 3 2025-06-24 "Tomo man-pages" +.SH NAME +Table.xor \- symmetric difference +.SH LIBRARY +Tomo Standard Library +.SH SYNOPSIS +.nf +.BI Table.xor\ :\ func(a:\ |T|,\ b:\ |T|\ ->\ |T|) +.fi +.SH DESCRIPTION +Return set with the elements in one, but not both of the arguments. This is also known as the symmetric difference or disjunctive union. + + +.SH ARGUMENTS + +.TS +allbox; +lb lb lbx lb +l l l l. +Name Type Description Default +a |T| The first set. - +b |T| The second set. - +.TE +.SH RETURN +A set with the symmetric difference of the arguments. + +.SH EXAMPLES +.EX +>> |1, 2, 3|.xor(|2, 3, 4|) += |1, 4| +.EE |
