It may seem facetious to say those four symbols and eight parentheses constitute a Lisp interpreter. When
Question:
It may seem facetious to say those four symbols and eight parentheses constitute a Lisp interpreter. When we write that line, have we really accomplished anything?
One answer to that question is to consider what we would have to do to write a Lisp
(or Pascal) interpreter in Pascal. We would need a lexical analyzer and a symbol table manager. This is a considerable amount of work, but it is all handled by read. We would need a syntactic parser to assemble the lexical tokens into statements. read also handles this, but only because Lisp statements have trivial syntax: the syntax of lists and atoms. Thus read serves fine as a syntactic parser for Lisp, but would fail for Pascal. Next, we need the evaluation or interpretation part of the interpreter;
eval does this nicely, and could handle Pascal just as well if we parsed Pascal syntax into Lisp expressions. print does much less work than read or eval, but is still quite handy.
Step by Step Answer:
Paradigms Of Artificial Intelligence Programming Case Studies In Common Lisp
ISBN: 9781558601918
1st Edition
Authors: Peter Norvig