This commit is contained in:
Justin Ethier 2018-01-15 18:05:16 -05:00
parent 12d16dfbbe
commit d549722cc4
2 changed files with 7 additions and 6 deletions

View file

@ -882,7 +882,11 @@
(cond (cond
((const? exp) exp) ((const? exp) exp)
((prim? exp) exp) ((prim? exp) exp)
((ref? exp) exp) ((ref? exp)
(let ((renamed (assoc exp local-renamed)))
(if renamed
(cdr renamed) ;; Extract renamed symbol
exp)))
((quote? exp) exp) ((quote? exp) exp)
;; TODO: rename all lambda formals and update rename-env accordingly. ;; TODO: rename all lambda formals and update rename-env accordingly.
;; will also require renaming refs later on here in expand... ;; will also require renaming refs later on here in expand...
@ -898,10 +902,7 @@
(map cdr a-lookup) (map cdr a-lookup)
ltype)) ltype))
) )
`(lambda ,(lambda->formals exp) `(lambda ,new-formals ;,(lambda->formals exp)
;; TODO: want this line instead of the above, but need to solve a crash
;; when compiling unit tests first (!!!)
;`(lambda ,new-formals ;,(lambda->formals exp)
,@(_expand-body ,@(_expand-body
'() '()
(lambda->exp exp) (lambda->exp exp)

View file

@ -4,7 +4,7 @@
(let ((x 'outer)) (let ((x 'outer))
;(let-syntax ((m (syntax-rules () ((m) x)))) ;(let-syntax ((m (syntax-rules () ((m) x))))
(let ((x 'inner)) (let ((x 'inner))
(list)))) ;; Should be outer (x)))) ;; Should be outer
; ) ; )
;;;; Just testing, may want to remove this one once the recursive macro expansion works ;;;; Just testing, may want to remove this one once the recursive macro expansion works
;;; (define-syntax my-or2 (syntax-rules () ;;; (define-syntax my-or2 (syntax-rules ()