9.5 Abstract Syntax
Consider the string ((lambda (x) (f x)) (g y)) representing an expression in λ-calculus. An implementation of a programming language, such as an interpreter or compiler, reads strings like this, typically from standard input, and processes them. This program string is an external representation (i.e., it is external to the system processing it) and uses concrete syntax. Programs in concrete syntax are not readily processable. Scheme, however, is a homoiconic language, meaning that program codes and data are both represented using the same representation—in the case of Scheme as a list. In consequence, the availability of a Scheme program as an S-expression is convenient for any system processing it. The (read) facility in ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access