Background
eval in main.c knows how to find and execute special forms - functions defined in C and referred to the global environment - but user functions, the let binding, and lexical scope still all need to be implemented. The bottom of functions might be let, or vice-versa - they are in essence two ways to create a closure, and should share semantics.
Implementing implies a mechanism for merging scopes and supporting the idea of a scope chain, which is also not done. Before we do this, we probably want to move away from using alists for environments, and use real hash tables instead.
Background
evalinmain.cknows how to find and execute special forms - functions defined in C and referred to the global environment - but user functions, the let binding, and lexical scope still all need to be implemented. The bottom of functions might be let, or vice-versa - they are in essence two ways to create a closure, and should share semantics.Implementing implies a mechanism for merging scopes and supporting the idea of a scope chain, which is also not done. Before we do this, we probably want to move away from using alists for environments, and use real hash tables instead.