aboutsummaryrefslogtreecommitdiff
path: root/docs/tutorial/expression.html
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2021-03-14 20:55:07 -0400
committerMarshall Lochbaum <mwlochbaum@gmail.com>2021-03-14 20:55:07 -0400
commit84039bf5248090b30845c1106f45a182e4aee901 (patch)
treecc5e9a616d62cd06f1e057a3b3a157115466bdaf /docs/tutorial/expression.html
parentd1b1bff0ac771da4f2431f7570e4e77749cc595e (diff)
Walk through one of the ∘ expressions
Diffstat (limited to 'docs/tutorial/expression.html')
-rw-r--r--docs/tutorial/expression.html1
1 files changed, 1 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'>