mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-11 23:07:36 +02:00
WIP - define-syntax
This commit is contained in:
parent
6c2958cf6c
commit
f107a40648
2 changed files with 14 additions and 6 deletions
7
Makefile
7
Makefile
|
@ -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
|
||||
|
||||
|
|
|
@ -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)))
|
||||
|
|
Loading…
Add table
Reference in a new issue