X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?a=blobdiff_plain;f=examples%2Fmetacirc.scm;h=170adaaadca8ed00287c0e7413938c8b917207ec;hb=72afc958cd27b43b8b535a28b49493f55d186983;hp=94787dd0b13dc0147d2a77ae38bcbeb9f2bd16ac;hpb=0dadd5f58d2c204c7f621ccd3c42f75a3fd790a8;p=scheme.forth.jl.git diff --git a/examples/metacirc.scm b/examples/metacirc.scm index 94787dd..170adaa 100644 --- a/examples/metacirc.scm +++ b/examples/metacirc.scm @@ -88,6 +88,13 @@ env) 'ok) +(define (eval-definition exp env) + (define-variable! + (definition-variable exp) + (eval (definition-value exp) env) + env) + 'ok) + (define (self-evaluating? exp) (cond ((number? exp) true) ((string? exp) true) @@ -329,6 +336,7 @@ (define-variable! 'false false initial-env) initial-env)) + (define (primitive-procedure? proc) (tagged-list? proc 'primitive)) @@ -352,8 +360,6 @@ (list 'primitive (cadr proc))) primitive-procedures)) - - (define (apply-primitive-procedure proc args) (apply-in-underlying-scheme (primitive-implementation proc) args)) @@ -390,5 +396,6 @@ ')) (display object))) -(define the-global-environment - (setup-environment)) + +(define the-global-environment (setup-environment)) +