6 ms·
One consequence of the parenthesis and prefix notation is that n-ary operators are idiomatic in lisps. So, the above example would more likely be written: (pri
by mcn 15y ago
One consequence of the parenthesis and prefix notation is that n-ary operators are idiomatic in lisps. So, the above example would more likely be written:
(print (++ a " " b " " c " "))
- Peaker 15y agoFor flat expressions, prefix is fine, and using n-ary operators is a great way to flatten many trees. n-ary operators cannot flatten every tree, though. When your tree isn't flat, and is built from primarily binary operators, infix makes the tree structure more apparent. The way we would draw trees on paper is how it would appear in the infix expression.