aboutsummaryrefslogtreecommitdiff
path: root/api
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-12-31 15:14:07 -0500
committerBruce Hill <bruce@bruce-hill.com>2025-12-31 15:14:07 -0500
commit41f92837bebae1de783dc7f4a8f880011c72757c (patch)
tree4730711a7c13c19c135d0432be4d1fe9b34c1f77 /api
parent1f13fa92a87bec65d1760266b108a5485bc14c7a (diff)
parentdbae987f1fb54da795185a03f4c00d56a639f8cd (diff)
Merge branch 'dev' into static-dependencies
Diffstat (limited to 'api')
-rw-r--r--api/api.md23
-rw-r--r--api/bytes.md7
-rw-r--r--api/bytes.yaml7
-rw-r--r--api/integers.md9
-rw-r--r--api/integers.yaml11
-rw-r--r--api/nums.md7
-rw-r--r--api/nums.yaml7
7 files changed, 40 insertions, 31 deletions
diff --git a/api/api.md b/api/api.md
index d035a3fe..df8386ff 100644
--- a/api/api.md
+++ b/api/api.md
@@ -295,15 +295,16 @@ Determines if an integer is between two numbers (inclusive).
Argument | Type | Description | Default
---------|------|-------------|---------
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); | -
-**Return:** `yes` if `low <= x and x <= high`, otherwise `no`
+**Return:** `yes` if `a <= x and x <= b` or `b <= x and x <= a`, otherwise `no`
**Example:**
```tomo
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
@@ -545,7 +546,7 @@ assert (255).hex(digits=4, uppercase=yes, prefix=yes) == "0x00FF"
## Int.is_between
```tomo
-Int.is_between : func(x: Int, low: Int, high: Int -> Bool)
+Int.is_between : func(x: Int, a: Int, b: Int -> Bool)
```
Determines if an integer is between two numbers (inclusive).
@@ -553,15 +554,16 @@ Determines if an integer is between two numbers (inclusive).
Argument | Type | Description | Default
---------|------|-------------|---------
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). | -
-**Return:** `yes` if `low <= x and x <= high`, otherwise `no`
+**Return:** `yes` if `a <= x and x <= b` or `a >= x and x >= b`, otherwise `no`
**Example:**
```tomo
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
@@ -1949,15 +1951,16 @@ Determines if a number is between two numbers (inclusive).
Argument | Type | Description | Default
---------|------|-------------|---------
x | `Num` | The integer to be checked. | -
-low | `Num` | The lower bound to check (inclusive). | -
-high | `Num` | The upper bound to check (inclusive). | -
+low | `Num` | One end of the range to check (inclusive). | -
+high | `Num` | The other end of the range to check (inclusive). | -
-**Return:** `yes` if `low <= x and x <= high`, otherwise `no`
+**Return:** `yes` if `a <= x and x <= b` or `b <= x and x <= a`, otherwise `no`
**Example:**
```tomo
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
diff --git a/api/bytes.md b/api/bytes.md
index bb54d92c..99055523 100644
--- a/api/bytes.md
+++ b/api/bytes.md
@@ -62,15 +62,16 @@ Determines if an integer is between two numbers (inclusive).
Argument | Type | Description | Default
---------|------|-------------|---------
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); | -
-**Return:** `yes` if `low <= x and x <= high`, otherwise `no`
+**Return:** `yes` if `a <= x and x <= b` or `b <= x and x <= a`, otherwise `no`
**Example:**
```tomo
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
diff --git a/api/bytes.yaml b/api/bytes.yaml
index dea650e2..adf7103b 100644
--- a/api/bytes.yaml
+++ b/api/bytes.yaml
@@ -57,7 +57,7 @@ Byte.is_between:
return:
type: 'Bool'
description: >
- `yes` if `low <= x and x <= high`, otherwise `no`
+ `yes` if `a <= x and x <= b` or `b <= x and x <= a`, otherwise `no`
args:
x:
type: 'Byte'
@@ -66,13 +66,14 @@ Byte.is_between:
low:
type: 'Byte'
description: >
- The lower bound to check (inclusive).
+ One end of the range to check (inclusive);
high:
type: 'Byte'
description: >
- The upper bound to check (inclusive).
+ The other end of the range to check (inclusive);
example: |
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
diff --git a/api/integers.md b/api/integers.md
index ef3a6a60..73779021 100644
--- a/api/integers.md
+++ b/api/integers.md
@@ -138,7 +138,7 @@ assert (255).hex(digits=4, uppercase=yes, prefix=yes) == "0x00FF"
## Int.is_between
```tomo
-Int.is_between : func(x: Int, low: Int, high: Int -> Bool)
+Int.is_between : func(x: Int, a: Int, b: Int -> Bool)
```
Determines if an integer is between two numbers (inclusive).
@@ -146,15 +146,16 @@ Determines if an integer is between two numbers (inclusive).
Argument | Type | Description | Default
---------|------|-------------|---------
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). | -
-**Return:** `yes` if `low <= x and x <= high`, otherwise `no`
+**Return:** `yes` if `a <= x and x <= b` or `a >= x and x >= b`, otherwise `no`
**Example:**
```tomo
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
diff --git a/api/integers.yaml b/api/integers.yaml
index b3c6b579..bbbd395d 100644
--- a/api/integers.yaml
+++ b/api/integers.yaml
@@ -146,22 +146,23 @@ Int.is_between:
return:
type: 'Bool'
description: >
- `yes` if `low <= x and x <= high`, otherwise `no`
+ `yes` if `a <= x and x <= b` or `a >= x and x >= b`, otherwise `no`
args:
x:
type: 'Int'
description: >
The integer to be checked.
- low:
+ a:
type: 'Int'
description: >
- The lower bound to check (inclusive).
- high:
+ One end of the range to check (inclusive).
+ b:
type: 'Int'
description: >
- The upper bound to check (inclusive).
+ The other end of the range to check (inclusive).
example: |
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
diff --git a/api/nums.md b/api/nums.md
index dac5967f..1bad194d 100644
--- a/api/nums.md
+++ b/api/nums.md
@@ -574,15 +574,16 @@ Determines if a number is between two numbers (inclusive).
Argument | Type | Description | Default
---------|------|-------------|---------
x | `Num` | The integer to be checked. | -
-low | `Num` | The lower bound to check (inclusive). | -
-high | `Num` | The upper bound to check (inclusive). | -
+low | `Num` | One end of the range to check (inclusive). | -
+high | `Num` | The other end of the range to check (inclusive). | -
-**Return:** `yes` if `low <= x and x <= high`, otherwise `no`
+**Return:** `yes` if `a <= x and x <= b` or `b <= x and x <= a`, otherwise `no`
**Example:**
```tomo
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
diff --git a/api/nums.yaml b/api/nums.yaml
index 4561bb91..28714ab9 100644
--- a/api/nums.yaml
+++ b/api/nums.yaml
@@ -401,7 +401,7 @@ Num.is_between:
return:
type: 'Bool'
description: >
- `yes` if `low <= x and x <= high`, otherwise `no`
+ `yes` if `a <= x and x <= b` or `b <= x and x <= a`, otherwise `no`
args:
x:
type: 'Num'
@@ -410,13 +410,14 @@ Num.is_between:
low:
type: 'Num'
description: >
- The lower bound to check (inclusive).
+ One end of the range to check (inclusive).
high:
type: 'Num'
description: >
- The upper bound to check (inclusive).
+ The other end of the range to check (inclusive).
example: |
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