>>8-9
Can be done in like 1-2 pages of code for Lisp-1 ( metacircular, no reader included ), and probably slightly longer for Lisp-2.
Name:
Anonymous2009-08-05 18:50
>>11
Doesn't the Lisp 1.5 manual include a 1-page implementation?
Name:
Anonymous2009-08-05 19:15
Meta-circular evaluation is discussed at length in section 4.1, titled The Metacircular Evaluator, of the MIT university textbook Structure and Interpretation of Computer Programs (SICP). The core idea they present is two functions:
* Eval which takes as arguments an expression and an environment (bindings for variables) and produces either a primitive or a procedure and a list of arguments
* Apply which takes two arguments, a procedure and a list of arguments to which the procedure should be applied and produces an expression and an environment
The two functions then call each other in circular fashion to fully evaluate a program.