3 ms·
A language is homoiconic if code in that language is written using the syntax of data literals of that language. In the case of most Lisps, code is written usi
by reikonomusha 4y ago
A language is homoiconic if code in that language is written using the syntax of data literals of that language.
In the case of most Lisps, code is written using the syntax of list and symbol literals. (There are other literals too, of course.)
(I (usually) like apples)
is a nested list literal with four symbols. You can think of symbols as "interned strings"; they're written without quotes for convenience. It's not unlike
["I", ["usually"], "like", "apples"]
in Python, except I had to use actual strings instead of symbols because Python doesn't ship with a standard symbol type.
This is also a nested literal list:
(loop for i below n do (print i))
but this happens to be a list literal that can be "run" (or in Lisp parlance, evaluated) as code.