diff --git a/cyclone.scm b/cyclone.scm index 27b8fc77..56f46c8a 100644 --- a/cyclone.scm +++ b/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)) '())) diff --git a/scheme/cyclone/macros.sld b/scheme/cyclone/macros.sld index 1d8438f5..1b7623e9 100644 --- a/scheme/cyclone/macros.sld +++ b/scheme/cyclone/macros.sld @@ -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 diff --git a/scheme/cyclone/transforms.sld b/scheme/cyclone/transforms.sld index 34c7453e..5e2ff45e 100644 --- a/scheme/cyclone/transforms.sld +++ b/scheme/cyclone/transforms.sld @@ -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