4 ms·
Virtually every lisp uses some non s-expression syntax which must be dealt with at the reader level. For example, using ' for quotation.
by disconcision 8y ago
Virtually every lisp uses some non s-expression syntax which must be dealt with at the reader level. For example, using ' for quotation.
- lispm 8y ago(3 4 +) (2 + 3) (- 3 4) All are valid s-expressions. Only one is a valid Lisp expression.
- kazinator 8y agoOr, in ANSI CL terms, only one is a valid form (S-expression suitable for or subject to evaluation).
- lispm 8y agoA form is already 'read' - it's an object. When we parse an expression, we usually parse a textual representation into an object. If the object is meant / subject to evaluation -> then we call this a form.
- kazinator 8y ago'(a b c) is considered an S-expression in Lisp dialects which support the 'X <-> (quote X) shorthand. It's just a shorthand, and it is read-print consistent, like other such shorthands. If '(a b c) isn't a S-exp, then we have backed into uncomfortable corners in which #(a b c) isn't an S-exp. Every character in a S-expression must be "dealt with at the reader level" (and produced at the printer level). The term "S-expression" was originally in contrast with "M-expression", but that's a historic usage.