맞게 conform을 씀

This commit is contained in:
msyds committed 2026-09-18 07:24:25 -06:00
1 parent eb15c68b2c
commit d7d18472c9
1 file changed
+6 -8
+6 -8
View File
@@ -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))))))