Comment by Peaker
15 years ago
Mathematicians have few prefix functions. Most functions are infix and many in more than one dimension.
I think a statement like "Most advanced mathematicians prefer Lisp" is pretty extraordinary and demands extraordinary citations.
Your comparison was dishonest, as you compared manual concat and print with a function that concats and prints. You really meant to compare full infix (e.g: in Haskell):
print $ a ++ " " ++ b ++ " " ++ c ++ " "
with full prefix:
(print (++ a (++ " " (++ b (++ " " (++ c " "))))))
Which do you find more readable?
The anti-precedence notion behind putting () around each application requires parenthesis even when associativity laws show that there is absolutely no difference between difference precedence interpretations. In this sense, the () are pure noise in this example.
Of course, if you use ++ so many times, you'd prefer to just use (in Haskell) something like:
print . intersperse " " $ [a, b, c]
Lisp's print has to embed the concatenation of its arguments or else it would look as horrible as shown above. It is still disingenuous to compare it as equal.
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 " "))
For 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.