I read in the book "Land of Lisp", the author mentions syntax expression
. Does that mean the ability to express syntax as a form of data? Is this the same as S-expression
(symbolic expression)?
A symbolic expression is data which is serialized as known from Lisp. It uses symbols, strings, numbers, lists and more. Lists are written in the form of (
expression
* )
.
Thee author of Land of Lisp talks about syntax expressions and Lisp syntax expressions. Seems like this is something he invented (discovered?). ;-) He probably means an expression in Lisp syntax, where something like (walk right)
is such an expression with the first element of the list being a verb.
In Common Lisp a valid expression of the programming language is called a Lisp form. So an s-expression can express all kinds of data, but not all s-expressions are valid Lisp programs. For example (defun)
is not a valid Common Lisp program, since it lacks a function name and a parameter list - plus the optional declarations, documentation and implementation body: (defun foo ())
.