3 ms·
In LISP, I would argue that the syntax is defined only partially by the concept of S-Expressions, but by the number of different kinds of atoms that can occur a
by waps 12y ago
In LISP, I would argue that the syntax is defined only partially by the concept of S-Expressions, but by the number of different kinds of atoms that can occur as the first atom in a free S-Expression. Well, all functions only define a single syntax form, but all macros define a new syntax form that should be counted separately.
Because of how LISP is structured, it is extremely tempting to have dozens of them for any reasonably-sized program.
In practice, in all LISPs, this number of syntax forms is quite high. In clojure it's somewhat less, but still a lot more than in "average" programming languages.
- lispm 12y agoThat's right. S-expressions are a syntax for data. s-expressions are not the syntax of Lisp. Lisp syntax is defined on top of s-expressions. In Common Lisp there are basically four forms of syntax: * data * function calls * special forms, basic building blocks of the language. There are only a fixed number and actually very few of them. * macro forms. Many provided by the language and user extensible. The user can write new macros or extend some existing macros. The main differences between many languages and Lisp: the syntax is extensible via macros and most of the time it is relatively simple to see the implementation and the expansion of a macro. Larger Lisp systems can contain hundreds of macros or even thousands of them...