Cleanup, removed dead code

This commit is contained in:
Justin Ethier 2017-12-17 18:44:37 -05:00
parent 274bf0acfa
commit 7d7ae2e89e

View file

@ -470,7 +470,7 @@
(define (analyze-letrec-syntax exp a-env)
(let* ((rename-env (env:extend-environment '() '() '()))
;; Build up a macro env
(vars (foldl (lambda (lis acc) (append acc (car lis))) '() a-env))
(vals (foldl (lambda (lis acc) (append acc (cdr lis))) '() a-env))
(zipped (apply map list vars (list vals)))
@ -485,11 +485,9 @@
(map (lambda (v)
(list 'macro (cadr v)))
defined-macros)
a-env))
;(create-environment '() '())))
a-env)) ;(create-environment '() '())))
;; Proceed with macro env
(expanded (expand exp macro-env rename-env))
;(expanded (expand exp a-env rename-env))
(cleaned (macro:cleanup expanded rename-env))
)
(analyze cleaned a-env)))
@ -854,18 +852,12 @@
(clean expr '()))
; TODO: get macro name, transformer
; TODO: let-syntax forms
;; Macro expansion
;TODO: modify this whole section to use macros:get-env instead of *defined-macros*. macro:get-env becomes the mac-env. any new scopes need to extend that env, and an env parameter needs to be added to (expand). any macros defined with define-syntax use that env as their mac-env (how to store that)?
; expand : exp -> exp
;; TODO: need a local version of each expand that receives a local env built by
;; let-syntax forms
;;(define (expand exp env rename-env local-env)
;;(define (_expand exp env rename-env)
(define (expand exp env rename-env)
(_expand exp env rename-env '()))