diff options
Diffstat (limited to 'man')
| -rw-r--r-- | man/man3/tomo-Byte.is_between.3 | 9 | ||||
| -rw-r--r-- | man/man3/tomo-Float.is_between.3 | 11 | ||||
| -rw-r--r-- | man/man3/tomo-Int.3 | 4 | ||||
| -rw-r--r-- | man/man3/tomo-Int.is_between.3 | 11 | ||||
| -rw-r--r-- | man/man3/tomo-Path.3 | 18 | ||||
| -rw-r--r-- | man/man3/tomo-Path.byte_writer.3 | 42 | ||||
| -rw-r--r-- | man/man3/tomo-Path.writer.3 | 42 |
7 files changed, 120 insertions, 17 deletions
diff --git a/man/man3/tomo-Byte.is_between.3 b/man/man3/tomo-Byte.is_between.3 index 06e53fb0..3b539ea1 100644 --- a/man/man3/tomo-Byte.is_between.3 +++ b/man/man3/tomo-Byte.is_between.3 @@ -2,7 +2,7 @@ .\" Copyright (c) 2025 Bruce Hill .\" All rights reserved. .\" -.TH Byte.is_between 3 2025-11-29 "Tomo man-pages" +.TH Byte.is_between 3 2025-12-31 "Tomo man-pages" .SH NAME Byte.is_between \- test if inside a range .SH LIBRARY @@ -23,15 +23,16 @@ lb lb lbx l l l. Name Type Description x Byte The integer to be checked. -low Byte The lower bound to check (inclusive). -high Byte The upper bound to check (inclusive). +low Byte One end of the range to check (inclusive); +high Byte The other end of the range to check (inclusive); .TE .SH RETURN -`yes` if `low <= x and x <= high`, otherwise `no` +`yes` if `a <= x and x <= b` or `b <= x and x <= a`, otherwise `no` .SH EXAMPLES .EX assert Byte(7).is_between(1, 10) == yes +assert Byte(7).is_between(10, 1) == yes assert Byte(7).is_between(100, 200) == no assert Byte(7).is_between(1, 7) == yes .EE diff --git a/man/man3/tomo-Float.is_between.3 b/man/man3/tomo-Float.is_between.3 index 34eb9c98..a1ad3135 100644 --- a/man/man3/tomo-Float.is_between.3 +++ b/man/man3/tomo-Float.is_between.3 @@ -1,8 +1,8 @@ '\" t -.\" Copyright (c) 2025 Bruce Hill +.\" Copyright (c) 2026 Bruce Hill .\" All rights reserved. .\" -.TH Float.is_between 3 2025-12-11 "Tomo man-pages" +.TH Float.is_between 3 2026-01-02 "Tomo man-pages" .SH NAME Float.is_between \- check if a number is in a range .SH LIBRARY @@ -23,15 +23,16 @@ lb lb lbx l l l. Name Type Description x Float The integer to be checked. -low Float The lower bound to check (inclusive). -high Float The upper bound to check (inclusive). +low Float One end of the range to check (inclusive). +high Float The other end of the range to check (inclusive). .TE .SH RETURN -`yes` if `low <= x and x <= high`, otherwise `no` +`yes` if `a <= x and x <= b` or `b <= x and x <= a`, otherwise `no` .SH EXAMPLES .EX assert (7.5).is_between(1, 10) == yes +assert (7.5).is_between(10, 1) == yes assert (7.5).is_between(100, 200) == no assert (7.5).is_between(1, 7.5) == yes .EE diff --git a/man/man3/tomo-Int.3 b/man/man3/tomo-Int.3 index 186c0aae..64ae7bf6 100644 --- a/man/man3/tomo-Int.3 +++ b/man/man3/tomo-Int.3 @@ -2,7 +2,7 @@ .\" Copyright (c) 2025 Bruce Hill .\" All rights reserved. .\" -.TH Int 3 2025-11-30 "Tomo man-pages" +.TH Int 3 2025-12-31 "Tomo man-pages" .SH NAME Int \- a Tomo type .SH LIBRARY @@ -59,7 +59,7 @@ For more, see: .TP -.BI Int.is_between\ :\ func(x:\ Int,\ low:\ Int,\ high:\ Int\ ->\ Bool) +.BI Int.is_between\ :\ func(x:\ Int,\ a:\ Int,\ b:\ Int\ ->\ Bool) Determines if an integer is between two numbers (inclusive). For more, see: diff --git a/man/man3/tomo-Int.is_between.3 b/man/man3/tomo-Int.is_between.3 index 8087e0d0..fd54eb41 100644 --- a/man/man3/tomo-Int.is_between.3 +++ b/man/man3/tomo-Int.is_between.3 @@ -2,14 +2,14 @@ .\" Copyright (c) 2025 Bruce Hill .\" All rights reserved. .\" -.TH Int.is_between 3 2025-11-29 "Tomo man-pages" +.TH Int.is_between 3 2025-12-31 "Tomo man-pages" .SH NAME Int.is_between \- test if an int is in a range .SH LIBRARY Tomo Standard Library .SH SYNOPSIS .nf -.BI Int.is_between\ :\ func(x:\ Int,\ low:\ Int,\ high:\ Int\ ->\ Bool) +.BI Int.is_between\ :\ func(x:\ Int,\ a:\ Int,\ b:\ Int\ ->\ Bool) .fi .SH DESCRIPTION Determines if an integer is between two numbers (inclusive). @@ -23,15 +23,16 @@ lb lb lbx l l l. Name Type Description x Int The integer to be checked. -low Int The lower bound to check (inclusive). -high Int The upper bound to check (inclusive). +a Int One end of the range to check (inclusive). +b Int The other end of the range to check (inclusive). .TE .SH RETURN -`yes` if `low <= x and x <= high`, otherwise `no` +`yes` if `a <= x and x <= b` or `a >= x and x >= b`, otherwise `no` .SH EXAMPLES .EX assert (7).is_between(1, 10) == yes +assert (7).is_between(10, 1) == yes assert (7).is_between(100, 200) == no assert (7).is_between(1, 7) == yes .EE diff --git a/man/man3/tomo-Path.3 b/man/man3/tomo-Path.3 index ae9b6d51..b916005a 100644 --- a/man/man3/tomo-Path.3 +++ b/man/man3/tomo-Path.3 @@ -2,7 +2,7 @@ .\" Copyright (c) 2025 Bruce Hill .\" All rights reserved. .\" -.TH Path 3 2025-12-07 "Tomo man-pages" +.TH Path 3 2025-12-22 "Tomo man-pages" .SH NAME Path \- a Tomo type .SH LIBRARY @@ -51,6 +51,14 @@ For more, see: .TP +.BI Path.byte_writer\ :\ func(path:\ Path,\ append:\ Bool\ =\ no,\ permissions:\ Int32\ =\ Int32(0o644)\ ->\ func(bytes:[Byte],\ close:Bool=no\ ->\ Result)) +Returns a function that can be used to repeatedly write bytes to the same file. + +For more, see: +.BR Tomo-Path.byte_writer (3) + + +.TP .BI Path.can_execute\ :\ func(path:\ Path\ ->\ Bool) Returns whether or not a file can be executed by the current user/group. @@ -345,3 +353,11 @@ Writes the given bytes to a unique file path based on the specified path. The fi For more, see: .BR Tomo-Path.write_unique_bytes (3) + +.TP +.BI Path.writer\ :\ func(path:\ Path,\ append:\ Bool\ =\ no,\ permissions:\ Int32\ =\ Int32(0o644)\ ->\ func(text:Text,\ close:Bool=no\ ->\ Result)) +Returns a function that can be used to repeatedly write to the same file. + +For more, see: +.BR Tomo-Path.writer (3) + diff --git a/man/man3/tomo-Path.byte_writer.3 b/man/man3/tomo-Path.byte_writer.3 new file mode 100644 index 00000000..595f0156 --- /dev/null +++ b/man/man3/tomo-Path.byte_writer.3 @@ -0,0 +1,42 @@ +'\" t +.\" Copyright (c) 2025 Bruce Hill +.\" All rights reserved. +.\" +.TH Path.byte_writer 3 2025-12-22 "Tomo man-pages" +.SH NAME +Path.byte_writer \- create a byte-based file writer +.SH LIBRARY +Tomo Standard Library +.SH SYNOPSIS +.nf +.BI Path.byte_writer\ :\ func(path:\ Path,\ append:\ Bool\ =\ no,\ permissions:\ Int32\ =\ Int32(0o644)\ ->\ func(bytes:[Byte],\ close:Bool=no\ ->\ Result)) +.fi +.SH DESCRIPTION +Returns a function that can be used to repeatedly write bytes to the same file. + + +.SH ARGUMENTS + +.TS +allbox; +lb lb lbx lb +l l l l. +Name Type Description Default +path Path The path of the file to write to. - +append Bool If set to \fByes\fR, writes to the file will append. If set to \fBno\fR, then the first write to the file will overwrite its contents and subsequent calls will append. no +permissions Int32 The permissions to set on the file if it is created. Int32(0o644) +.TE +.SH RETURN +Returns a function that can repeatedly write bytes to the same file. If `close` is set to `yes`, then the file will be closed after writing. If this function is called again after closing, the file will be reopened for appending. + +.SH NOTES +The file writer will keep its file descriptor open after each write (unless the `close` argument is set to `yes`). If the file writer is never closed, it will be automatically closed when the file writer is garbage collected. + +.SH EXAMPLES +.EX +write := (./file.txt).byte_writer() +write("Hello\[rs]n".utf8())! +write("world\[rs]n".utf8(), close=yes)! +.EE +.SH SEE ALSO +.BR Tomo-Path (3) diff --git a/man/man3/tomo-Path.writer.3 b/man/man3/tomo-Path.writer.3 new file mode 100644 index 00000000..8b3d53d8 --- /dev/null +++ b/man/man3/tomo-Path.writer.3 @@ -0,0 +1,42 @@ +'\" t +.\" Copyright (c) 2025 Bruce Hill +.\" All rights reserved. +.\" +.TH Path.writer 3 2025-12-22 "Tomo man-pages" +.SH NAME +Path.writer \- create a file writer +.SH LIBRARY +Tomo Standard Library +.SH SYNOPSIS +.nf +.BI Path.writer\ :\ func(path:\ Path,\ append:\ Bool\ =\ no,\ permissions:\ Int32\ =\ Int32(0o644)\ ->\ func(text:Text,\ close:Bool=no\ ->\ Result)) +.fi +.SH DESCRIPTION +Returns a function that can be used to repeatedly write to the same file. + + +.SH ARGUMENTS + +.TS +allbox; +lb lb lbx lb +l l l l. +Name Type Description Default +path Path The path of the file to write to. - +append Bool If set to \fByes\fR, writes to the file will append. If set to \fBno\fR, then the first write to the file will overwrite its contents and subsequent calls will append. no +permissions Int32 The permissions to set on the file if it is created. Int32(0o644) +.TE +.SH RETURN +Returns a function that can repeatedly write to the same file. If `close` is set to `yes`, then the file will be closed after writing. If this function is called again after closing, the file will be reopened for appending. + +.SH NOTES +The file writer will keep its file descriptor open after each write (unless the `close` argument is set to `yes`). If the file writer is never closed, it will be automatically closed when the file writer is garbage collected. + +.SH EXAMPLES +.EX +write := (./file.txt).writer() +write("Hello\[rs]n")! +write("world\[rs]n", close=yes)! +.EE +.SH SEE ALSO +.BR Tomo-Path (3) |
