aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-04-18 16:21:19 -0400
committerBruce Hill <bruce@bruce-hill.com>2025-04-18 16:21:19 -0400
commit0974d632c3dda7874f01c58bfc342b73cd1634a4 (patch)
tree67fecbca860bb6156ba403d55315fa71eae11436
parent171d80ac1e5bd006c2c600f36a42440dfb635605 (diff)
Fix docs
-rw-r--r--docs/integers.md6
-rw-r--r--docs/lists.md9
-rw-r--r--docs/nums.md2
3 files changed, 9 insertions, 8 deletions
diff --git a/docs/integers.md b/docs/integers.md
index 1ee47cbd..b37f93ab 100644
--- a/docs/integers.md
+++ b/docs/integers.md
@@ -134,7 +134,7 @@ can be called either on the type itself: `Int.sqrt(x)` or as a method call:
- [`func octal(i: Int, digits: Int = 0, prefix: Bool = yes -> Text)`](#octal)
- [`func onward(first: Int, step: Int = 1 -> Text)`](#onward)
- [`func parse(text: Text -> Int?)`](#parse)
-- [`func prev_prime(x: Int -> Int)`](#prev_prime)
+- [`func prev_prime(x: Int -> Int?)`](#prev_prime)
- [`func sqrt(x: Int -> Int)`](#sqrt)
- [`func to(first: Int, last: Int, step : Int? = none -> func(->Int?))`](#to)
@@ -442,13 +442,13 @@ See [the GNU MP docs](https://gmplib.org/manual/Number-Theoretic-Functions#index
for more details.
```tomo
-func prev_prime(x: Int -> Int)
+func prev_prime(x: Int -> Int?)
```
- `x`: The integer before which to find the previous prime.
**Returns:**
-The previous prime number less than `x`.
+The previous prime number less than `x`, or `none` if `x` is less than 2.
**Example:**
```tomo
diff --git a/docs/lists.md b/docs/lists.md
index 9f15457b..141f6abd 100644
--- a/docs/lists.md
+++ b/docs/lists.md
@@ -240,7 +240,7 @@ variable or dereference a heap pointer, it may trigger copy-on-write behavior.
- [`func find(list: [T], target: T -> Int?)`](#find)
- [`func first(list: [T], predicate: func(item:&T -> Bool) -> Int)`](#first)
- [`func from(list: [T], first: Int -> [T])`](#from)
-- [`func has(list: [T] -> Bool)`](#has)
+- [`func has(list: [T], element: T -> Bool)`](#has)
- [`func heap_pop(list: @[T], by: func(x,y:&T->Int32) = T.compare -> T?)`](#heap_pop)
- [`func heap_push(list: @[T], item: T, by=T.compare -> Void)`](#heap_push)
- [`func heapify(list: @[T], by: func(x,y:&T->Int32) = T.compare -> Void)`](#heapify)
@@ -422,16 +422,17 @@ A new list starting from the specified index.
---
### `has`
-Checks if the list has any elements.
+Checks if the list has an element.
```tomo
-func has(list: [T] -> Bool)
+func has(list: [T], element: T -> Bool)
```
- `list`: The list to check.
+- `target`: The element to check for.
**Returns:**
-`yes` if the list has elements, `no` otherwise.
+`yes` if the list has the target, `no` otherwise.
**Example:**
```tomo
diff --git a/docs/nums.md b/docs/nums.md
index 62cf3564..c209d74d 100644
--- a/docs/nums.md
+++ b/docs/nums.md
@@ -377,7 +377,7 @@ Returns the given number clamped between two values so that it is within
that range.
```tomo
-clamped(x, low, high: Num -> Num)
+func clamped(x, low, high: Num -> Num)
```
- `x`: The number to clamp.