mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-13 07:47:39 +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
|
||||
(let ((macros (filter
|
||||
(lambda (v)
|
||||
(macro? (Cyc-get-cvar (cdr v))))
|
||||
(Cyc-macro? (Cyc-get-cvar (cdr v))))
|
||||
(Cyc-global-vars))))
|
||||
(set! *defined-macros*
|
||||
(append
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
(define (macro:macro? exp defined-macros) (assoc (car exp) defined-macros))
|
||||
|
||||
(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)))))
|
||||
;(newline)
|
||||
;(display "/* ")
|
||||
|
|
|
@ -698,7 +698,7 @@
|
|||
(let ((macro (env:lookup name env #f)))
|
||||
(cond
|
||||
((and (tagged-list? 'macro macro)
|
||||
(or (macro? (Cyc-get-cvar (cadr macro)))
|
||||
(or (Cyc-macro? (Cyc-get-cvar (cadr macro)))
|
||||
(procedure? (cadr macro))))
|
||||
(trace:info `(DEBUG compiled macro ,name do not redefine)))
|
||||
(else
|
||||
|
|
|
@ -272,7 +272,6 @@
|
|||
(list 'pair? pair?)
|
||||
(list 'port? port?)
|
||||
(list 'procedure? procedure?)
|
||||
(list 'macro? macro?)
|
||||
(list 'Cyc-macro? Cyc-macro?)
|
||||
(list 'vector? vector?)
|
||||
(list 'bytevector? bytevector?)
|
||||
|
@ -436,7 +435,7 @@
|
|||
#f))
|
||||
(expand
|
||||
(lambda (macro-op)
|
||||
(if (macro? macro-op)
|
||||
(if (Cyc-macro? macro-op)
|
||||
;; Compiled macro, call directly
|
||||
(analyze (apply macro-op
|
||||
(list (cons (car exp) (operands exp))
|
||||
|
@ -455,7 +454,7 @@
|
|||
a-env))))))
|
||||
(cond
|
||||
;; compiled macro
|
||||
((macro? var)
|
||||
((Cyc-macro? var)
|
||||
(expand var))
|
||||
;; compiled or interpreted macro in compound form
|
||||
((compound-macro? var)
|
||||
|
|
Loading…
Add table
Reference in a new issue