mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-13 15:57:36 +02:00
Replace (macro?) with (Cyc-macro?)
This commit is contained in:
parent
f75b077270
commit
089a64d290
4 changed files with 5 additions and 6 deletions
|
@ -119,7 +119,7 @@
|
||||||
;; Load macros for expansion phase
|
;; Load macros for expansion phase
|
||||||
(let ((macros (filter
|
(let ((macros (filter
|
||||||
(lambda (v)
|
(lambda (v)
|
||||||
(macro? (Cyc-get-cvar (cdr v))))
|
(Cyc-macro? (Cyc-get-cvar (cdr v))))
|
||||||
(Cyc-global-vars))))
|
(Cyc-global-vars))))
|
||||||
(set! *defined-macros*
|
(set! *defined-macros*
|
||||||
(append
|
(append
|
||||||
|
|
|
@ -52,7 +52,7 @@
|
||||||
(define (macro:macro? exp defined-macros) (assoc (car exp) defined-macros))
|
(define (macro:macro? exp defined-macros) (assoc (car exp) defined-macros))
|
||||||
|
|
||||||
(define (macro:expand exp macro mac-env)
|
(define (macro:expand exp macro mac-env)
|
||||||
(let* ((compiled-macro? (or (macro? (Cyc-get-cvar (cadr macro)))
|
(let* ((compiled-macro? (or (Cyc-macro? (Cyc-get-cvar (cadr macro)))
|
||||||
(procedure? (cadr macro)))))
|
(procedure? (cadr macro)))))
|
||||||
;(newline)
|
;(newline)
|
||||||
;(display "/* ")
|
;(display "/* ")
|
||||||
|
|
|
@ -698,7 +698,7 @@
|
||||||
(let ((macro (env:lookup name env #f)))
|
(let ((macro (env:lookup name env #f)))
|
||||||
(cond
|
(cond
|
||||||
((and (tagged-list? 'macro macro)
|
((and (tagged-list? 'macro macro)
|
||||||
(or (macro? (Cyc-get-cvar (cadr macro)))
|
(or (Cyc-macro? (Cyc-get-cvar (cadr macro)))
|
||||||
(procedure? (cadr macro))))
|
(procedure? (cadr macro))))
|
||||||
(trace:info `(DEBUG compiled macro ,name do not redefine)))
|
(trace:info `(DEBUG compiled macro ,name do not redefine)))
|
||||||
(else
|
(else
|
||||||
|
|
|
@ -272,7 +272,6 @@
|
||||||
(list 'pair? pair?)
|
(list 'pair? pair?)
|
||||||
(list 'port? port?)
|
(list 'port? port?)
|
||||||
(list 'procedure? procedure?)
|
(list 'procedure? procedure?)
|
||||||
(list 'macro? macro?)
|
|
||||||
(list 'Cyc-macro? Cyc-macro?)
|
(list 'Cyc-macro? Cyc-macro?)
|
||||||
(list 'vector? vector?)
|
(list 'vector? vector?)
|
||||||
(list 'bytevector? bytevector?)
|
(list 'bytevector? bytevector?)
|
||||||
|
@ -436,7 +435,7 @@
|
||||||
#f))
|
#f))
|
||||||
(expand
|
(expand
|
||||||
(lambda (macro-op)
|
(lambda (macro-op)
|
||||||
(if (macro? macro-op)
|
(if (Cyc-macro? macro-op)
|
||||||
;; Compiled macro, call directly
|
;; Compiled macro, call directly
|
||||||
(analyze (apply macro-op
|
(analyze (apply macro-op
|
||||||
(list (cons (car exp) (operands exp))
|
(list (cons (car exp) (operands exp))
|
||||||
|
@ -455,7 +454,7 @@
|
||||||
a-env))))))
|
a-env))))))
|
||||||
(cond
|
(cond
|
||||||
;; compiled macro
|
;; compiled macro
|
||||||
((macro? var)
|
((Cyc-macro? var)
|
||||||
(expand var))
|
(expand var))
|
||||||
;; compiled or interpreted macro in compound form
|
;; compiled or interpreted macro in compound form
|
||||||
((compound-macro? var)
|
((compound-macro? var)
|
||||||
|
|
Loading…
Add table
Reference in a new issue