make default-environment a zero-ary procedure

This commit is contained in:
Yuichi Nishiwaki 2017-04-15 02:56:31 +09:00
parent dfe8e87e65
commit b89de785ee
2 changed files with 1650 additions and 1648 deletions

File diff suppressed because it is too large Load Diff

View File

@ -112,7 +112,8 @@
core#if core#if
core#begin core#begin
core#define-macro)) core#define-macro))
env)) (lambda ()
env)))
(define (extend-environment parent) (define (extend-environment parent)
(%make-environment parent #f (make-ephemeron-table))) (%make-environment parent #f (make-ephemeron-table)))
@ -224,7 +225,7 @@
(error "invalid expression" expr)))) (error "invalid expression" expr))))
(define (expand expr . env) (define (expand expr . env)
(let ((x (expand-node expr (if (null? env) default-environment (car env))))) (let ((x (expand-node expr (if (null? env) (default-environment) (car env)))))
(run-all) (run-all)
x)) x))
@ -253,7 +254,7 @@
(dictionary-set! (macro-objects) name transformer)) (dictionary-set! (macro-objects) name transformer))
(define (the var) (define (the var)
(make-identifier var default-environment)) (make-identifier var (default-environment)))
(let (let
;; cache popular identifiers ;; cache popular identifiers