3 ms·
Good call on the diamonds. Echoing everyone else, basically, your other points are a bit shortsighted. You never need code that edits itself - completely true
by lostcolony 12y ago
Good call on the diamonds.
Echoing everyone else, basically, your other points are a bit shortsighted.
You never need code that edits itself - completely true. Completely missing the point. Most programming features fall into this category; you don't -need- them, you could always use assembly instead. The point is that once you get them into your brain as an option, problems that might otherwise be tricky or time consuming become much easier.
To that end, everything is an expression is a list...yeah, you don't need it either. But, assuming the above (that code that can edit itself turns out useful sometimes), imagine how easy it is to metaprogram when all your executable code is just a list, and you already know how to modify lists.
In either case, you don't -need- the feature, sure, but a moment's reflection might open up the possibility that once you fully grok the ramifications, and have it amongst your other programming tools, you'll find a good use for it.
As to too many parentheses, as someone else mentioned,
foo(a, b, c)
simply becomes
(foo a b c)
Not really any more of them.
- GregBuchholz 12y agohmm... c = sqrt(a*a + b*b) (setf c (sqrt (+ (* a a) (* b b))))
- thoth 12y agoAmusing... but to be fair, this is also an operator precedence issue where C is letting you drop several pairs.
- GregBuchholz 12y ago>where C ...I think operator precedence allows the removal of the parenthesis for at least: Ada, C, C++, D, Dylan, Erlang, Fortran, Go, Haskell, Icon, Java, Javascript, Julia, Lua, Mathematica, OCaml, Pascal, Perl, Prolog, Python, QBasic, R, Ruby, Scala, and TCL.
- kazagistar 12y agoI don't see how that is supposed to be a valid excuse. Non-lisps tend to support operator precedence, reducing the number of parens significantly. Thus, the argument "other languages require the same number of parens" is completely false.