From 8b13461967492e23111209c6f87f96ad61b4f5c1 Mon Sep 17 00:00:00 2001 From: Tim Vaughan Date: Fri, 22 Jul 2016 20:24:00 +1200 Subject: [PATCH] Working on compound procedures. --- scheme.4th | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/scheme.4th b/scheme.4th index ae88b4b..1e58af9 100644 --- a/scheme.4th +++ b/scheme.4th @@ -13,7 +13,8 @@ include defer-is.4th 4 constant nil-type 5 constant pair-type 6 constant symbol-type -7 constant primitive-type +7 constant primitive-proc-type +8 constant compound-proc-type : istype? ( obj type -- obj bool ) over = ; @@ -197,6 +198,7 @@ create-symbol define define-symbol create-symbol set! set!-symbol create-symbol ok ok-symbol create-symbol if if-symbol +create-symbol lambda lambda-symbol \ }}} @@ -333,7 +335,7 @@ global-env setobj cons symbol-table setobj - rot primitive-type ( var prim ) + rot primitive-proc-type ( var prim ) global-env fetchobj define-var ; @@ -956,7 +958,7 @@ defer eval 2over 2over operator 2swap eval - primitive-type istype? false = if + primitive-proc-type istype? false = if bold fg red ." Object not applicable. Aboring." reset-term cr abort then @@ -1047,7 +1049,7 @@ defer print symbol-type istype? if printsymbol exit then nil-type istype? if printnil exit then pair-type istype? if ." (" printpair ." )" exit then - primitive-type istype? if printprim exit then + primitive-proc-type istype? if printprim exit then bold fg red ." Error printing expression - unrecognized type. Aborting" reset-term cr abort -- 2.20.1