Re:Lisp-Flavored Programming Languages
by rusini on Tuesday November 26, 2019 @09:17PM
(#21644734)
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.
[ Parent
| on HN ]
> 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, ..).