Implement 5.30; on to last section; let's go!

This commit is contained in:
2021-04-11 13:50:56 -04:00
parent 59b58cfb9a
commit f60931f80e
3 changed files with 67 additions and 10 deletions

View File

@@ -36,8 +36,12 @@ unknown-procedure-type
(assign val (const unknown-procedure-type-error))
(goto (label signal-error))
unbound-variable-error
(assign val (const unbound-variable-error))
error-unbound-variable
(assign val (const error-unbound-variable))
(goto (label signal-error))
apply-primitive-error
(assign val (op apply-primitive-result) (reg val))
(goto (label signal-error))
signal-error
@@ -74,10 +78,9 @@ ev-self-eval
(assign val (reg exp))
(goto (reg continue))
ev-variable
;(perform (op user-print) (reg exp))
(assign val (op lookup-variable-value) (reg exp) (reg env))
(test (op unbound-variable?) (reg val))
(branch (label unbound-variable-error))
(branch (label error-unbound-variable))
(goto (reg continue))
ev-quoted
(assign val (op text-of-quotation) (reg exp))
@@ -137,9 +140,14 @@ apply-dispatch
(goto (label unknown-procedure-type))
primitive-apply
(assign val (op apply-primitive-procedure)
(assign val (op apply-primitive-procedure-safe)
(reg proc)
(reg argl))
;(perform (op user-print) (reg val))
;(perform (op newline))
(test (op apply-primitive-error?) (reg val))
(branch (label apply-primitive-error))
(assign val (op apply-primitive-result) (reg val))
(restore continue)
(goto (reg continue))