WIP - define-syntax

This commit is contained in:
Justin Ethier 2015-08-04 21:36:10 -04:00
parent 6c2958cf6c
commit f107a40648
2 changed files with 14 additions and 6 deletions

View file

@ -139,3 +139,10 @@ uninstall:
$(RMDIR) $(DESTDIR)$(DATADIR)/scheme
$(RMDIR) $(DESTDIR)$(DATADIR)
trans:
sudo cp scheme/cyclone/transforms.scm /usr/local/share/cyclone/scheme/cyclone/
cyclone scheme/cyclone/transforms.sld
sudo cp scheme/cyclone/transforms.* /usr/local/share/cyclone/scheme/cyclone/
cyclone cyclone.scm
sudo cp cyclone /usr/local/bin/cyclone

View file

@ -913,12 +913,13 @@
;; if found. would then want to continue expanding. may need to
;; 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? exp) ;; TODO: not good enough, should do error checking, and make sure list is big enough for cadr
; (let* ((name (cadr exp))
; (trans (caddr exp))
; (body (cadr trans)))
; (set! *defined-macros* (cons (cons name body) *defined-macros*))
; #t))
((define-syntax? exp) ;; TODO: not good enough, should do error checking, and make sure list is big enough for cadr
(trace:info `(define-syntax ,exp))
(let* ((name (cadr exp))
(trans (caddr exp))
(body (cadr trans)))
(set! *defined-macros* (cons (cons name body) *defined-macros*))
#t))
((macro? exp)
(expand ;; Could expand into another macro
(macro-expand exp)))