4 ms·
Common Lisp acknowledges at least one syntax class: setf forms[1]. [1] http://www.lispworks.com/documentation/HyperSpec/Body/m_defset.htm http://www.lispworks.
by kmill 9y ago
Common Lisp acknowledges at least one syntax class: setf forms[1].
[1] http://www.lispworks.com/documentation/HyperSpec/Body/m_defset.htm http://www.lispworks.com/documentation/HyperSpec/Body/m_defs...
- kazinator 9y agoAnother one is, for example, the "lambda list" and "macro/destructuring lambda list". We can write some new macro and say that the "foo argument is a destructuring lambda list". The macro then inserts that into the target code in some way that it is interpreted that way. Yes, however, in CL terminology, everything in fact is an expression. In (let ((a b)) ...)`, (a b)* is an expression. What is is not is a form: an expression intended to be evaluated. Not every expression is a form. (Other dialects may have different terminology).
- kmill 9y agoSource: http://www.lispworks.com/documentation/HyperSpec/Body/26_glo_e.htm#expression http://www.lispworks.com/documentation/HyperSpec/Body/26_glo... It is interesting that when people say "everything is an expression," they usually seem to mean that "everything evaluates to a value," as a contrast to the expression/statement dichotomy in most other languages. But (summarizing) as far as Common Lisp is concerned, an "expression" is the object of what one expresses. Let expression1 mean the syntax class of expressions-with-values (like mathematical expressions) and expression2 be the Common Lisp definition. Then it's "in Lisp, everything is an expression2" and "every form is an expression1." This ambiguity might explain the surprise when realizing Lisp in fact has other syntax classes than expression1s.