I'll start with
>>67.
https://en.wikipedia.org/wiki/S-expressionS-expressions are just syntax. Code and data both, indeed. S-expressions are atoms and lists of S-expressions. A list is delimited by parentheses. That is all there is to it.
The s-expression is the let form!
Not yet. That is a list of three S-expressions; starting with the atom
let
.
It just so happens that this form represents a valid program (for whatever implementation of Lisp this is that doesn't require double-parenthesised let bindings).
To compare,
(let my ass)
is also a valid S-expression, but not a valid program.
The
let
form will be part of the AST. The pipeline involved in parsing a valid Lisp program: characters -> tokens -> S-expressions -> AST.
>>65Your error is less egregious.
This is obviously unhomogenous: not every form is a s-exp anymore
Much like
'(a b c)
is syntactic sugar for
(quote a b c)
, so too is
[a b c]
sugar for
(vector a b c)
. There being values other than plain lists and atoms does not imply un-homoiconicity (which I believe is the term you were looking for).
For example,
(let [args (vector x 5)] (eval `(let ,args (+ x 1))))
would be equivalent to
(let [x 5] (+ x 1))
(I think; I am tired).
Like quote, unquote, and quasiquote, the square brackets don't remove homoiconicity. They just add convenience.