The syntax of S-expressions is the syntax. It's a form to serialize trees (made out of pairs) and it is described by some grammar.
> The syntax of S-expressions is the syntax.
of s-expressions. Lisp has an additional layer of syntax on top of s-expressions.
For example the DEFINE-CONDITION operator has this syntax:
define-condition name (parent-type*) ({slot-spec}*) option* => name
slot-spec::= slot-name | (slot-name slot-option)
slot-option::= [[{:reader symbol}* |
{:writer function-name}* |
{:accessor symbol}* |
{:allocation allocation-type} |
{:initarg symbol}* |
{:initform form} |
{:type type-specifier} ]]
option::= [[(:default-initargs . initarg-list) |
(:documentation string) |
(:report report-name) ]]
function-name::= {symbol | (setf symbol)}
allocation-type::= :instance | :class
report-name::= string | symbol | lambda expression
with even more syntax for things like lambda expressions and type specifiers.
Re:Lisp-Flavored Programming Languages
by rusini on Wednesday November 27, 2019 @09:23AM
(#21648025)
I know :) And that's cool, and that property is the base of my own programming language. I am also trying right now to find some explanation why it's cool based on some fundamental conclusions from theoretic computer science...
I just feel that when someone says that Lisp does not have syntax or that syntax is not important, it's plain wrong...
> I just feel that when someone says that Lisp does not have syntax or that syntax is not important, it's plain wrong...
I completely agree. I just feel that not every programming language needs to have the same approach to syntax. Lisp is different from most languages in its way to have a data syntax in which programs are written. Thus the data syntax is textual (s-expressions) and the program syntax is structural (based on data structures like lists, symbols, numbers, ..).
The lack of syntax matters in the sense that once you don't have any you realise that it just gets in the way. Having lots of parentheses is a small price to pay for powerful tools so that's why "it doesn't matter". Non-lispers generally don't understand how lisp is different from their language of choice and therefore don't understand why the lack of syntax is an advantage.