diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2021-03-14 20:55:07 -0400 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2021-03-14 20:55:07 -0400 |
| commit | 84039bf5248090b30845c1106f45a182e4aee901 (patch) | |
| tree | cc5e9a616d62cd06f1e057a3b3a157115466bdaf | |
| parent | d1b1bff0ac771da4f2431f7570e4e77749cc595e (diff) | |
Walk through one of the ∘ expressions
| -rw-r--r-- | docs/tutorial/expression.html | 1 | ||||
| -rw-r--r-- | tutorial/expression.md | 2 |
2 files changed, 3 insertions, 0 deletions
diff --git a/docs/tutorial/expression.html b/docs/tutorial/expression.html index 6be69727..ee088ee4 100644 --- a/docs/tutorial/expression.html +++ b/docs/tutorial/expression.html @@ -347,6 +347,7 @@ </tr> </table> +<p>For example, the first expression <code><span class='Number'>3</span> <span class='Function'>×</span><span class='Modifier'>˜</span><span class='Modifier2'>∘</span><span class='Function'>+</span> <span class='Number'>4</span></code> expands to <code><span class='Function'>×</span><span class='Modifier'>˜</span> <span class='Number'>3</span> <span class='Function'>+</span> <span class='Number'>4</span></code>. Summing up, we get <code><span class='Function'>×</span><span class='Modifier'>˜</span> <span class='Number'>7</span></code>, which from the previous section is <code><span class='Number'>7</span> <span class='Function'>×</span> <span class='Number'>7</span></code>, or <code><span class='Number'>49</span></code>.</p> <p>It's past time we covered how the syntax for modifiers works. Remember how I told you you hated learning the order of operations? No? Good. Modifiers bind more tightly than functions, so they are called on their operands before those operands can be used as arguments. As the parentheses above suggest, modifiers associate from left to right, the opposite order as functions. For example, the first expression above is evaluated in the order shown below. First we construct the square function <code><span class='Function'>×</span><span class='Modifier'>˜</span></code>, then compose it with <code><span class='Function'>+</span></code>, and finally apply the result to some arguments.</p> <svg viewBox='-212.64 -34 512 134'> <g font-family='BQN,monospace' font-size='18px' class='Paren' fill='currentColor'> diff --git a/tutorial/expression.md b/tutorial/expression.md index 4c2b79b1..813e751f 100644 --- a/tutorial/expression.md +++ b/tutorial/expression.md @@ -193,6 +193,8 @@ Made it to the last role, the 2-modifier (if you think something's been skipped, <!--GEN Primitives ⟨"∘%j%Atop"⟩ --> +For example, the first expression `3 ט∘+ 4` expands to `ט 3 + 4`. Summing up, we get `ט 7`, which from the previous section is `7 × 7`, or `49`. + It's past time we covered how the syntax for modifiers works. Remember how I told you you hated learning the order of operations? No? Good. Modifiers bind more tightly than functions, so they are called on their operands before those operands can be used as arguments. As the parentheses above suggest, modifiers associate from left to right, the opposite order as functions. For example, the first expression above is evaluated in the order shown below. First we construct the square function `ט`, then compose it with `+`, and finally apply the result to some arguments. <!--GEN |
