This commit is contained in:
Justin Ethier 2015-08-31 23:06:24 -04:00
parent a01086e904
commit 117ddab3f4

View file

@ -222,7 +222,7 @@
;; ER macro rename function, based on code from Chibi scheme ;; ER macro rename function, based on code from Chibi scheme
(define (Cyc-er-rename mac-env) (define (Cyc-er-rename mac-env)
(lambda (sym) sym)) ; TODO: temporary placeholder, see below ; (lambda (sym) sym)) ; TODO: temporary placeholder, see below
;TODO: I think we're ready to cut back over to this now? ;TODO: I think we're ready to cut back over to this now?
@ -263,15 +263,15 @@
; a new lambda scope is introduced? ; a new lambda scope is introduced?
; - need to keep track of it for compiled macro expansion ; - need to keep track of it for compiled macro expansion
; ;
; ((lambda (renames) ((lambda (renames)
; (lambda (identifier) (lambda (identifier)
; ((lambda (cell) ((lambda (cell)
; (if cell ; (if cell
; (cdr cell) ; (cdr cell)
; ((lambda (name) ; ((lambda (name)
; (set! renames (cons (cons identifier name) renames)) ; (set! renames (cons (cons identifier name) renames))
; name) ; name)
;
; (let ((val (env:lookup identifier mac-env 'not-defined))) ; (let ((val (env:lookup identifier mac-env 'not-defined)))
; (cond ; (cond
; ((eq? val 'not-defined) ; ((eq? val 'not-defined)
@ -290,17 +290,19 @@
; ; ; ;
; ;(make-syntactic-closure mac-env '() identifier) ; ;(make-syntactic-closure mac-env '() identifier)
; ))) ; )))
; (assq identifier renames)))) identifier)
; ;; TODO: For now, do not allow renaming of special form symbols to (assq identifier renames))
; ;; prevent issues within the compiler ))
; '( ;; TODO: For now, do not allow renaming of special form symbols to
; (define . define) ;; prevent issues within the compiler
; (define-syntax . define-syntax) '(
; (if . if) (define . define)
; (lambda . lambda) (define-syntax . define-syntax)
; (quote . quote) (if . if)
; (set! . set!) (lambda . lambda)
; ))) (quote . quote)
(set! . set!)
)))
(define (Cyc-er-compare? a b) (define (Cyc-er-compare? a b)
;; TODO: this is not good enough, need to determine if these symbols ;; TODO: this is not good enough, need to determine if these symbols