diff --git a/chapter3/interpreter.coffee b/chapter3/interpreter.coffee index b793ceb..258fb5f 100644 --- a/chapter3/interpreter.coffee +++ b/chapter3/interpreter.coffee @@ -175,7 +175,13 @@ evaluate = (e, env) -> when "begin" then eprogn (cdr exp), env when "set!" then update (nvalu cadr exp), env, (evaluate (caddr exp), env) when "lambda" then make_function (astSymbolsToLispSymbols cadr exp), (cddr exp), env - else invoke (evaluate (car exp), env), (evlis (cdr exp), env) + + else + # Note that invoke ultimately resolves to a (native) + # function generated by make_function, and a (interpreter) + # list that the generated (native) function knows how to + # unpack into the actual (native) operation. + invoke (evaluate (car exp), env), (evlis (cdr exp), env) else invoke (evaluate (car exp), env), (evlis (cdr exp), env) else