aboutsummaryrefslogtreecommitdiff
path: root/man
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-10-11 15:50:19 -0400
committerBruce Hill <bruce@bruce-hill.com>2025-10-11 15:50:19 -0400
commit436d2e02debe058e9968935e742e397c19de628a (patch)
treec51d08a586ead5c4f22d3f2d12695c4a7cf6cbca /man
parent7e8604daeb9239e1669c5414dd6caa37af30c4ff (diff)
Improvements to set support and updating docs
Diffstat (limited to 'man')
-rw-r--r--man/man3/tomo-Byte.to.318
-rw-r--r--man/man3/tomo-List.clear.34
-rw-r--r--man/man3/tomo-List.heap_push.34
-rw-r--r--man/man3/tomo-List.heapify.36
-rw-r--r--man/man3/tomo-List.shuffle.34
-rw-r--r--man/man3/tomo-List.unique.310
-rw-r--r--man/man3/tomo-Path.expand_home.310
-rw-r--r--man/man3/tomo-Text.from_codepoint_names.312
-rw-r--r--man/man3/tomo-Text.translate.320
-rw-r--r--man/man3/tomo-getenv.36
10 files changed, 47 insertions, 47 deletions
diff --git a/man/man3/tomo-Byte.to.3 b/man/man3/tomo-Byte.to.3
index 9982f5da..15774ba7 100644
--- a/man/man3/tomo-Byte.to.3
+++ b/man/man3/tomo-Byte.to.3
@@ -2,7 +2,7 @@
.\" Copyright (c) 2025 Bruce Hill
.\" All rights reserved.
.\"
-.TH Byte.to 3 2025-04-30 "Tomo man-pages"
+.TH Byte.to 3 2025-10-11 "Tomo man-pages"
.SH NAME
Byte.to \- iterate over a range of bytes
.SH LIBRARY
@@ -31,13 +31,13 @@ An iterator function that returns each byte in the given range (inclusive).
.SH EXAMPLES
.EX
->> Byte(2).to(5)
-= func(->Byte?)
->> [x for x in Byte(2).to(5)]
-= [Byte(2), Byte(3), Byte(4), Byte(5)]
->> [x for x in Byte(5).to(2)]
-= [Byte(5), Byte(4), Byte(3), Byte(2)]
+iter := Byte(2).to(4)
+assert iter() == 2
+assert iter() == 3
+assert iter() == 4
+assert iter() == none
->> [x for x in Byte(2).to(5, step=2)]
-= [Byte(2), Byte(4)]
+assert [x for x in Byte(2).to(5)] == [Byte(2), Byte(3), Byte(4), Byte(5)]
+assert [x for x in Byte(5).to(2)] == [Byte(5), Byte(4), Byte(3), Byte(2)]
+assert [x for x in Byte(2).to(5, step=2)] == [Byte(2), Byte(4)]
.EE
diff --git a/man/man3/tomo-List.clear.3 b/man/man3/tomo-List.clear.3
index e912c983..bece5524 100644
--- a/man/man3/tomo-List.clear.3
+++ b/man/man3/tomo-List.clear.3
@@ -2,7 +2,7 @@
.\" Copyright (c) 2025 Bruce Hill
.\" All rights reserved.
.\"
-.TH List.clear 3 2025-04-30 "Tomo man-pages"
+.TH List.clear 3 2025-10-11 "Tomo man-pages"
.SH NAME
List.clear \- clear a list
.SH LIBRARY
@@ -29,5 +29,5 @@ Nothing.
.SH EXAMPLES
.EX
->> my_list.clear()
+my_list.clear()
.EE
diff --git a/man/man3/tomo-List.heap_push.3 b/man/man3/tomo-List.heap_push.3
index 5da4a40a..3c1804bd 100644
--- a/man/man3/tomo-List.heap_push.3
+++ b/man/man3/tomo-List.heap_push.3
@@ -2,7 +2,7 @@
.\" Copyright (c) 2025 Bruce Hill
.\" All rights reserved.
.\"
-.TH List.heap_push 3 2025-04-30 "Tomo man-pages"
+.TH List.heap_push 3 2025-10-11 "Tomo man-pages"
.SH NAME
List.heap_push \- heap push
.SH LIBRARY
@@ -31,5 +31,5 @@ Nothing.
.SH EXAMPLES
.EX
->> my_heap.heap_push(10)
+my_heap.heap_push(10)
.EE
diff --git a/man/man3/tomo-List.heapify.3 b/man/man3/tomo-List.heapify.3
index af7fafd1..345a47b9 100644
--- a/man/man3/tomo-List.heapify.3
+++ b/man/man3/tomo-List.heapify.3
@@ -2,7 +2,7 @@
.\" Copyright (c) 2025 Bruce Hill
.\" All rights reserved.
.\"
-.TH List.heapify 3 2025-04-30 "Tomo man-pages"
+.TH List.heapify 3 2025-10-11 "Tomo man-pages"
.SH NAME
List.heapify \- convert a list into a heap
.SH LIBRARY
@@ -30,6 +30,6 @@ Nothing.
.SH EXAMPLES
.EX
->> my_heap := [30, 10, 20]
->> my_heap.heapify()
+my_heap := [30, 10, 20]
+my_heap.heapify()
.EE
diff --git a/man/man3/tomo-List.shuffle.3 b/man/man3/tomo-List.shuffle.3
index 7d7e1def..875a73c6 100644
--- a/man/man3/tomo-List.shuffle.3
+++ b/man/man3/tomo-List.shuffle.3
@@ -2,7 +2,7 @@
.\" Copyright (c) 2025 Bruce Hill
.\" All rights reserved.
.\"
-.TH List.shuffle 3 2025-04-30 "Tomo man-pages"
+.TH List.shuffle 3 2025-10-11 "Tomo man-pages"
.SH NAME
List.shuffle \- shuffle a list in place
.SH LIBRARY
@@ -30,5 +30,5 @@ Nothing.
.SH EXAMPLES
.EX
->> list.shuffle()
+list.shuffle()
.EE
diff --git a/man/man3/tomo-List.unique.3 b/man/man3/tomo-List.unique.3
index cab945b8..9ed81687 100644
--- a/man/man3/tomo-List.unique.3
+++ b/man/man3/tomo-List.unique.3
@@ -2,17 +2,17 @@
.\" Copyright (c) 2025 Bruce Hill
.\" All rights reserved.
.\"
-.TH List.unique 3 2025-09-21 "Tomo man-pages"
+.TH List.unique 3 2025-10-11 "Tomo man-pages"
.SH NAME
List.unique \- get the unique items in a list
.SH LIBRARY
Tomo Standard Library
.SH SYNOPSIS
.nf
-.BI List.unique\ :\ func(list:\ [T]\ ->\ [T])
+.BI List.unique\ :\ func(list:\ [T]\ ->\ {T})
.fi
.SH DESCRIPTION
-Returns a list of the unique elements of the list.
+Returns a set of the unique elements of the list.
.SH ARGUMENTS
@@ -25,9 +25,9 @@ Name Type Description Default
list [T] The list to process. -
.TE
.SH RETURN
-A list of the unique elements from the list.
+A set of the unique elements from the list.
.SH EXAMPLES
.EX
-assert [10, 20, 10, 10, 30].unique() == [10, 20, 30]
+assert [10, 20, 10, 10, 30].unique() == {10, 20, 30}
.EE
diff --git a/man/man3/tomo-Path.expand_home.3 b/man/man3/tomo-Path.expand_home.3
index 5dcf6a77..7114b65b 100644
--- a/man/man3/tomo-Path.expand_home.3
+++ b/man/man3/tomo-Path.expand_home.3
@@ -2,7 +2,7 @@
.\" Copyright (c) 2025 Bruce Hill
.\" All rights reserved.
.\"
-.TH Path.expand_home 3 2025-05-17 "Tomo man-pages"
+.TH Path.expand_home 3 2025-10-11 "Tomo man-pages"
.SH NAME
Path.expand_home \- expand ~ to $HOME
.SH LIBRARY
@@ -29,8 +29,8 @@ If the path does not start with a `~`, then return it unmodified. Otherwise, rep
.SH EXAMPLES
.EX
->> (~/foo).expand_home() # Assume current user is 'user'
-= /home/user/foo
->> (/foo).expand_home() # No change
-= /foo
+# Assume current user is 'user'
+assert (~/foo).expand_home() == (/home/user/foo)
+# No change
+assert (/foo).expand_home() == (/foo)
.EE
diff --git a/man/man3/tomo-Text.from_codepoint_names.3 b/man/man3/tomo-Text.from_codepoint_names.3
index 4d9dc59d..4a1f9f56 100644
--- a/man/man3/tomo-Text.from_codepoint_names.3
+++ b/man/man3/tomo-Text.from_codepoint_names.3
@@ -2,7 +2,7 @@
.\" Copyright (c) 2025 Bruce Hill
.\" All rights reserved.
.\"
-.TH Text.from_codepoint_names 3 2025-04-30 "Tomo man-pages"
+.TH Text.from_codepoint_names 3 2025-10-11 "Tomo man-pages"
.SH NAME
Text.from_codepoint_names \- convert list of unicode codepoint names to text
.SH LIBRARY
@@ -32,10 +32,10 @@ The text will be normalized, so the resulting text's codepoints may not exactly
.SH EXAMPLES
.EX
->> Text.from_codepoint_names([
-"LATIN CAPITAL LETTER A WITH RING ABOVE",
-"LATIN SMALL LETTER K",
-"LATIN SMALL LETTER E",
+text := Text.from_codepoint_names([
+ "LATIN CAPITAL LETTER A WITH RING ABOVE",
+ "LATIN SMALL LETTER K",
+ "LATIN SMALL LETTER E",
]
-= "Åke"
+assert text == "Åke"
.EE
diff --git a/man/man3/tomo-Text.translate.3 b/man/man3/tomo-Text.translate.3
index e8b36ec4..8cfeb3f7 100644
--- a/man/man3/tomo-Text.translate.3
+++ b/man/man3/tomo-Text.translate.3
@@ -2,14 +2,14 @@
.\" Copyright (c) 2025 Bruce Hill
.\" All rights reserved.
.\"
-.TH Text.translate 3 2025-04-30 "Tomo man-pages"
+.TH Text.translate 3 2025-10-11 "Tomo man-pages"
.SH NAME
Text.translate \- perform multiple replacements
.SH LIBRARY
Tomo Standard Library
.SH SYNOPSIS
.nf
-.BI Text.translate\ :\ func(text:\ Text,\ translations:\ {Text=Text}\ ->\ Text)
+.BI Text.translate\ :\ func(text:\ Text,\ translations:\ {Text:Text}\ ->\ Text)
.fi
.SH DESCRIPTION
Takes a table mapping target texts to their replacements and performs all the replacements in the table on the whole text. At each position, the first matching replacement is applied and the matching moves on to *after* the replacement text, so replacement text is not recursively modified. See Text.replace() for more information about replacement behavior.
@@ -23,19 +23,19 @@ lb lb lbx lb
l l l l.
Name Type Description Default
text Text The text to be translated. -
-translations {Text=Text} A table mapping from target text to its replacement. -
+translations {Text:Text} A table mapping from target text to its replacement. -
.TE
.SH RETURN
The text with all occurrences of the targets replaced with their corresponding replacement text.
.SH EXAMPLES
.EX
->> "A <tag> & an amperand".translate({
- "&" = "&amp;",
- "<" = "&lt;",
- ">" = "&gt;",
- '"" = "&quot",
- "'" = "&#39;",
+text := "A <tag> & an amperand".translate({
+ "&": "&amp;",
+ "<": "&lt;",
+ ">": "&gt;",
+ '"": "&quot",
+ "'": "&#39;",
})
-= "A &lt;tag&gt; &amp; an ampersand"
+assert text == "A &lt;tag&gt; &amp; an ampersand"
.EE
diff --git a/man/man3/tomo-getenv.3 b/man/man3/tomo-getenv.3
index e06e35ff..84bef6be 100644
--- a/man/man3/tomo-getenv.3
+++ b/man/man3/tomo-getenv.3
@@ -2,7 +2,7 @@
.\" Copyright (c) 2025 Bruce Hill
.\" All rights reserved.
.\"
-.TH getenv 3 2025-05-17 "Tomo man-pages"
+.TH getenv 3 2025-10-11 "Tomo man-pages"
.SH NAME
getenv \- get an environment variable
.SH LIBRARY
@@ -29,6 +29,6 @@ If set, the environment variable's value, otherwise, `none`.
.SH EXAMPLES
.EX
->> getenv("TERM")
-= "xterm-256color"?
+assert getenv("TERM") == "xterm-256color"
+assert getenv("not_a_variable") == none
.EE