|
|
|
|
|
by nickbauman
5172 days ago
|
|
Lisp languages have virtually no syntax. Example: Write a function that generates a string of all the numbers in a range from a start and end value. Java (lots of syntax, many tokens): String rangeString(int start, int end) {
String oni = "";
for(int i = start; i < (1 + end); i++) {
oni += String.valueOf(i);
}
} Clojure (almost no syntax): (defn [start end]
(apply str (range start (inc end)))) |
|
I personally don't think that having less lexical syntax is useful for the things you mention. Lisp has extensible abstract syntax, so overall, it probably has the largest syntax of all.