Hacker News new | ask | show | jobs
by dTal 1854 days ago
It is for this reason that it is misleading to say that lisp languages "have no syntax" - they do have considerable constraints on their structure. It's almost as if there's a third layer between "syntax" and "semantics" - or perhaps the word "syntax" conceals two distinct types of structure.
2 comments

'syntax' is actually a useful term in this context. But this syntax works on token tree data. The token trees is the code as s-expression data.

The Lisp syntax then is defined for these token trees.

For example the syntax for an argument list in Common Lisp is defined with an EBNF syntax description form:

  lambda-list::= (var* 
                  [&optional {var | (var [init-form [supplied-p-parameter]])}*] 
                  [&rest var] 
                  [&key {var | ({var | (keyword-name var)} [init-form [supplied-p-parameter]])}* [&allow-other-keys]] 
                  [&aux {var | (var [init-form])}*])
The XML people came up with the word "schema" for the remaining shape of a datum when the details of recovering the tree itself from the tokens are settled.