From d7d18472c9a115d05cc886a933749ce6dd546ce6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Madeleine=20Sydney=20=C5=9Alaga?= Date: Fri, 18 Sep 2026 07:24:01 -0600 Subject: [PATCH] =?UTF-8?q?=EB=A7=9E=EA=B2=8C=20conform=EC=9D=84=20?= =?UTF-8?q?=EC=94=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/expand.clj | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/expand.clj b/src/expand.clj index 1271909..905716b 100644 --- a/src/expand.clj +++ b/src/expand.clj @@ -210,7 +210,7 @@ (transcribe* 0 unification (s/conform ::template template))) (comment - (transcribe-transformer scheme-and '(and 1))) + (transcribe-transformer scheme-and '(and 1 2))) (defn transcribe-transformer [trans datum] (some (fn [{:keys [pattern template]}] @@ -317,8 +317,7 @@ (for [[x rhs] bindings] (bind-lexical [x scopes*] - [:macro (->> (expand rhs env symtable-ref scopes) - (s/conform ::transformer))] + [:macro (expand rhs env symtable-ref scopes)] symtable-ref)))] (concat (list 'let-syntax bindings) (for [e body] @@ -326,8 +325,9 @@ (defmethod expand-primitive 'syntax-rules [datum _ env symtable-ref scopes] - (assert (s/valid? ::prim-syntax-rules datum)) - datum) + (let [r (s/conform ::prim-syntax-rules datum)] + (assert (not (s/invalid? r))) + r)) (defn expand ([datum] @@ -346,8 +346,6 @@ (match (lookup [f scopes] env @symtable-ref) [:primitive prim] (expand-primitive datum prim env symtable-ref scopes) - [:macro trans] (todo "trans %s" (->> trans - (s/conform ::prim-syntax-rules) - pr-str)) + [:macro trans] (todo "trans %s" (->> (pr-str trans))) _ (cons (expand f env symtable-ref scopes) (map #(expand % env symtable-ref scopes) xs))))))