SAPF Parentheses

What is the function of parentheses in SAPF code? It doesn’t seem like there’s any mention of them, but they do appear in examples.

                Thank You For Your Attention

could be wrong but really just a visual aid if you can add or omit and it won’t change the output

Parentheses are mostly a visual aid to indicate the boundaries of subexpressions — BUT they do evaluate the subexpression on an empty stack, so if the subexpression tries to take an outside value from the stack, it will be an error. This is a way to guarantee that your code is doing what you think.

Parentheses are never necessary. They can always be removed from correct code.

3 Likes