diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2022-06-25 22:20:19 -0400 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2022-06-25 22:20:24 -0400 |
| commit | c618ade174cc2b4e428457751ad8dd01130c2239 (patch) | |
| tree | 2c0840b92204d77ec982a6cf7cb6a1e4f738545f /doc/undo.md | |
| parent | e62c37d34604f6a2293e981d2fd986729e70d2c9 (diff) | |
Back to editing docs
Diffstat (limited to 'doc/undo.md')
| -rw-r--r-- | doc/undo.md | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/doc/undo.md b/doc/undo.md index 4afa2c00..fe27fa37 100644 --- a/doc/undo.md +++ b/doc/undo.md @@ -18,7 +18,7 @@ Here it undoes a function to decrement the last character by incrementing that c ## The rules -If `ð”½` can be inverted exactly, then Undo just does that. However, there are also some other functions that BQN inverts. For example, the squaring function `ט` has both a positive and a negative inverse, and yet: +If `ð”½` can be inverted exactly, then Undo just does that (or tries). However, there are also some other functions that BQN inverts. For example, the squaring function `ט` has both a positive and a negative inverse, and yet: ט ¯3 ט⼠ט ¯3 # It's not the same! @@ -40,6 +40,7 @@ A few notable inverses are the [logarithm](arithmetic.md#basic-arithmetic) `⋆â Structural functions like [Take](take.md) and [shifts](shift.md) that remove elements from `ð•©` can't be inverted, because given the result there's no way to know what the elements should be. However, there are two special cases that have inverses defined despite losing data: these are `⊣â¼` and `kâ¼` where `k` is a constant (a data type, or `kË™`). For these, `ð•©` is required to [match](match.md) the always returned value `ð•¨` or `k`, and this value is also used for the result—even though any result would be valid, as these functions ignore `ð•©`. 3 ⊣⼠4 + 3 ⊣⼠3 ## Undo headers @@ -51,4 +52,7 @@ Of course BQN will never be able to invert all the functions you could write (if ð•Šâ¼ð•©: ð•©Ã·1-ð•© } -The above function could also be defined with the automatically invertible `1⊸+⌾÷`, but maybe there's a numerical reason to use the definition above. Like a normal header, an undo header reflects the normal use, but it includes `â¼` and possibly `Ëœ` addition to the function and arguments. +The above function could also be defined with the automatically invertible `1⊸+⌾÷`, but maybe there's a numerical reason to use the definition above. Like a normal header, an undo header reflects the normal use, but it includes `â¼` and possibly `Ëœ` addition to the function and arguments. Any header that includes a function can have these modifiers added—even a fancy modifier header like `ð”½_m1â¼a‿b:` or plain label like `ð•Šâ¼:`. The three forms are `ð•Šâ¼ð•©:`, `ð•¨ð•Šâ¼ð•©:`, and `ð•¨ð•ŠËœâ¼ð•©:`, and the two dyadic forms are also used to derive `k⊸Fâ¼ð•©` and `F⟜kâ¼ð•©` with a constant `k`. + + G ↠{ ð•ŠËœâ¼:ð•©-2×𕨠; ð•¨+2×𕩠} + G⟜2â¼ 7 |
