3 ms·
Prefix/postfix/infix refer to the order in which you write operations and their operands—equivalently you can think of preorder/postorder/inorder traversals of
by evincarofautumn 10y ago
Prefix/postfix/infix refer to the order in which you write operations and their operands—equivalently you can think of preorder/postorder/inorder traversals of the syntax tree.
AST +
/ \
* 5
/ \
2 3
Infix 2 * 3 + 5
2 times 3 plus 5.
Prefix + * 2 3 5
Lisp (+ (* 2 3) 5)
The sum of the product of 2 and 3, and 5.
Postfix 2 3 * 5 +
With 2 and 3, multiply. Then with 5, add.
- Tiksi 10y agoAhh, understood now. I figured postscript as it's also a concatinative programming language. I read postfix as in the mail server not as a synonym of suffix, thanks for the clarification.
- klibertp 10y ago> synonym of suffix Antonym, actually. Prefixes are literally on the other end of things than suffixes are ;)
- TallGuyShort 10y agoHe's talking about postfix, not prefix. It's closer to being a synonym of suffic.
- klibertp 10y agoOh shit, true. My mistake. Sorry!