Skip to content

Commit db5c6aa

Browse files
committed
fix recur docs
1 parent 8c491a5 commit db5c6aa

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

parser/src/defs.rs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3074,22 +3074,27 @@ primitive!(
30743074
/// Many of the examples here can be better expressed using array operations, and are merely demonstrative.
30753075
///
30763076
/// We can express a simple recursive factorial function like so.
3077-
/// ex: Fact ← recur(<2|-1|×)
3077+
/// ex: # Experimental!
3078+
/// : Fact ← recur(<2|-1|×)
30783079
/// : Fact 5
30793080
/// : Fact 7
30803081
/// The [less than]`2` determines when to cease recursion. The [subtract]`1` is the next recursive call, the "child node". The [multiply] gets called on a node and the result of its child.
30813082
///
30823083
/// We can express the classic recursive fibanacci function in a similar way. In this example, the second function returns two children. The third function ignores the parent node and simply adds the results of the children.
3083-
/// ex: Fib ← recur(<2|⊃[-1|-2]|/+)
3084+
/// ex: # Experimental!
3085+
/// : Fib ← recur(<2|⊃[-1|-2]|/+)
30843086
/// : Fib 10
3085-
/// Because a boolean result from the first function returns a node as its own result, that example interprets the 0th fibonacci number to be `0``.
3087+
/// Because a boolean result from the first function returns a node as its own result, that example interprets the 0th fibonacci number to be `0`.
30863088
/// If we instead want the 0th fibonacci to be `1`, we can return a list of 0 or 1 items from the first function instead. A 1-item list is interpreted as a leaf node, with that item as the result.
3087-
/// ex: Fib ← recur(▽⊙1<2|⊃[-1|-2]|/+)
3089+
/// In this example, we use `keep``dip``1` to return `[1]` if the node is `less than``2` or `[]` if it is not.
3090+
/// ex: # Experimental!
3091+
/// : Fib ← recur(▽⊙1<2|⊃[-1|-2]|/+)
30883092
/// : Fib 10
30893093
///
30903094
/// The results of a node's children will be passed to the third function as an array. The creation of this array will fail if the results of the children have incompatible shapes. There is an acception for box lists, which will be [join]ed instead of used as rows. This makes it possible to combine variable-length lists.
30913095
/// One example use case for this is listing all files in all subdirectories.
3092-
/// ex: ListFiles ← recur&fif&fld∘
3096+
/// ex: # Experimental!
3097+
/// : ListFiles ← recur&fif&fld∘
30933098
/// : ListFiles "."
30943099
([3], Recur, Algorithm, "recur", { experimental: true }),
30953100
/// Calculate the derivative of a mathematical expression

site/Trunk.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ no_sri = true
44
public_url = "/"
55

66
[watch]
7-
watch = [".", "../src", "../pad/editor", "../changelog.md"]
7+
watch = [".", "../src", "../parser", "../pad/editor", "../changelog.md"]
88

99
[serve]
1010
address = "0.0.0.0"

0 commit comments

Comments
 (0)