mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-13 15:57:36 +02:00
WIP
This commit is contained in:
parent
1444e89d73
commit
915915b75f
3 changed files with 14 additions and 11 deletions
18
cyclone.scm
18
cyclone.scm
|
@ -117,13 +117,15 @@
|
|||
(lambda (v)
|
||||
(macro? (Cyc-get-cvar (cdr v))))
|
||||
(Cyc-global-vars))))
|
||||
(trace:info (map
|
||||
(lambda (v)
|
||||
; TODO: can prepend these macros to *defined-macros*, but
|
||||
; also need to use Cyc-get-cvar to deref before using macro
|
||||
; during expansion
|
||||
(cons (car v) (cdr v)))
|
||||
macros)))
|
||||
(set! *defined-macros*
|
||||
(append
|
||||
;(map
|
||||
; (lambda (v)
|
||||
; (cons (car v) (cdr v)))
|
||||
; macros))
|
||||
macros
|
||||
*defined-macros*)))
|
||||
TODO: try this again, make sure macro is loaded: (trace:info *defined-macros*)
|
||||
;; END JAE DEBUG
|
||||
|
||||
(set! input-program (expand input-program))
|
||||
|
@ -271,7 +273,7 @@
|
|||
(in-prog (read-file in-file))
|
||||
(program? (not (library? (car in-prog))))
|
||||
(lib-deps
|
||||
(if (and program?
|
||||
(if (my-and program?
|
||||
(tagged-list? 'import (car in-prog)))
|
||||
(lib:get-all-import-deps (cdar in-prog))
|
||||
'()))
|
||||
|
|
|
@ -49,10 +49,10 @@
|
|||
|
||||
;; assumes ER macro
|
||||
(if macro
|
||||
((cdr macro)
|
||||
((Cyc-get-cvar (cdr macro))
|
||||
;exp
|
||||
; could be a raw lambda, if that is the case try quoting it
|
||||
(if (procedure? (cdr macro))
|
||||
(if (macro? (Cyc-get-cvar (cdr macro)))
|
||||
exp
|
||||
(list 'quote exp))
|
||||
rename
|
||||
|
|
|
@ -1048,8 +1048,9 @@
|
|||
;would have to look up symbol to see if it is a macro, and then get the macro that way...
|
||||
;may need to have a *define-macros* equivalent but in the compiled code, similar to globals.
|
||||
;need to be able to look up var in a list and get the (macro?) instance.
|
||||
((or (macro? exp)
|
||||
((or ;(macro? exp)
|
||||
(macro:macro? exp *defined-macros*))
|
||||
(trace:info (list 'expanding exp))
|
||||
(expand ;; Could expand into another macro
|
||||
(macro:expand exp *defined-macros*)))
|
||||
(else
|
||||
|
|
Loading…
Add table
Reference in a new issue