Content deleted Content added
syntax |
more on backquote etc |
||
Line 1:
In the programming language [[Lisp]], the '''reader''' or '''<code>read</code> function''' is the [[parser]] which converts the textual form of Lisp objects to the corresponding internal object structure.
In the original Lisp, S-expressions consisted only of [[symbol (programming)|symbol]]s, integers, and the list constructors <code>( <i>x<sub>i</sub>...</i> )</code> and <code>(<i>x</i> . <i>y</i>)</code>. Later Lisps, culminating in [[Common Lisp]], added literals for floating-point, complex, and rational numbers, strings, and constructors for vectors.
The reader is responsible for parsing list structure, [[String interning|interning]] symbols, converting numbers to internal form, and calling read macros.
==Read table==
Line 9 ⟶ 11:
==Read macros{{anchor|Read macros}}==
Unlike most programming languages, Lisp supports parse-time execution of programs, called "read macros" or "reader macros". These are used to extend the syntax either in universal or program-specific ways. For example, the [[Lisp_(programming_language)#Self-evaluating_forms_and_quoting|quoted form]] <code>(quote <i>x</i>)</code> operator can be abbreviated as <code>'<i>x</i></code>. The <code>'</code> operator
==Notes==
|