aboutsummaryrefslogtreecommitdiff
path: root/tutorial/expression.md
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2020-10-16 13:01:19 -0400
committerMarshall Lochbaum <mwlochbaum@gmail.com>2020-10-16 13:24:13 -0400
commitbbce87e26a262a2f442b86608bae06bfd42f3b0e (patch)
tree5182dc737638b329787ee130277c09d825b57e86 /tutorial/expression.md
parentd1813495bce24c37049abdca553bfb184f3ab753 (diff)
First expression diagram
Diffstat (limited to 'tutorial/expression.md')
-rw-r--r--tutorial/expression.md7
1 files changed, 3 insertions, 4 deletions
diff --git a/tutorial/expression.md b/tutorial/expression.md
index 59fe827c..39738d51 100644
--- a/tutorial/expression.md
+++ b/tutorial/expression.md
@@ -57,10 +57,9 @@ For a longer example, here's an expression for the [volume of a sphere](https://
The evaluation order is shown below, with the function `⋆` on the first line evaluated first, then `×` on the next, and so on. The effect of the parentheses is that `÷` is evaluated before the leftmost `×`.
- = 2⋆3
- π ×
- 4÷3
- ( ) ×
+<!--SVG evalexp.bqn
+DrawEval "(4÷3) × π × 2⋆3"
+-->
The following rule might help you to internalize this system in addition to identifying when parentheses are needed: an expression never needs to end with a parenthesis, or contain two closing parentheses in a row. If it does, at least one set of parentheses can be removed.