From 5b557f889dc46fdeaf2ca2e5abe62557034d3734 Mon Sep 17 00:00:00 2001 From: Justin Ethier Date: Mon, 1 Feb 2016 23:01:25 -0500 Subject: [PATCH] WIP --- macro-test.scm | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/macro-test.scm b/macro-test.scm index bf4eab89..8243c019 100644 --- a/macro-test.scm +++ b/macro-test.scm @@ -53,6 +53,21 @@ (append result (reverse expanded-exprs)) (cdr exp) env))) + ;; TODO: test concept of expanding/splicing begin here + ((and (app? (car exp)) + (symbol? (caar exp)) + (tagged-list? 'macro (env:lookup (caar exp) env #f))) + (let ((expanded (macro:expand (car exp) (env:lookup (caar exp) env #f) env))) +(write `(DEBUG ,(cons expanded (cdr exp)))) + ;; TODO: not enough to recursively call expand-body with commented-out code. + ;; maybe the thing that was missing is that still need to call inner-expand to + ;; expand macros within???? + (expand-body + (cons + (inner-expand expanded env) + result) ;; TODO: result? + (cdr exp) ;(cons expanded (cdr exp)) + env))) (else (expand-body (cons