This commit is contained in:
Justin Ethier 2015-08-05 02:03:24 -04:00
parent 7b766b2721
commit 6c2958cf6c

View file

@ -913,12 +913,12 @@
;; if found. would then want to continue expanding. may need to ;; if found. would then want to continue expanding. may need to
;; return some value such as #t or nil as a placeholder, since the ;; return some value such as #t or nil as a placeholder, since the
;; define-syntax form would not be carried forward in the compiled code ;; define-syntax form would not be carried forward in the compiled code
((define-syntax? exp) ; ((define-syntax? exp) ;; TODO: not good enough, should do error checking, and make sure list is big enough for cadr
(let* ((name (cadr exp)) ; (let* ((name (cadr exp))
(trans (caddr exp)) ; (trans (caddr exp))
(body (cadr trans))) ; (body (cadr trans)))
(set! *defined-macros* (cons (cons name body) *defined-macros*)) ; (set! *defined-macros* (cons (cons name body) *defined-macros*))
#t)) ; #t))
((macro? exp) ((macro? exp)
(expand ;; Could expand into another macro (expand ;; Could expand into another macro
(macro-expand exp))) (macro-expand exp)))