This commit is contained in:
1 parent
daf910757a
commit
7282e44c5a
2 files changed
+45
-24
No files matched your search
+7
-5
@@ -51,10 +51,10 @@
|
||||
|
||||
(s/def ::identifier
|
||||
(s/and ::syntax
|
||||
#(symbol? (scm/stx-datum %))))
|
||||
#(symbol? (scm/syntax-e %))))
|
||||
|
||||
(s/fdef expand
|
||||
:args (s/cat :syntax ::syntax
|
||||
:args (s/cat :stx ::syntax
|
||||
:env ::environment
|
||||
:store ::store)
|
||||
:ret ::syntax)
|
||||
@@ -81,8 +81,8 @@
|
||||
(second (apply max-key first xs))))
|
||||
|
||||
(defn lookup [ident env store]
|
||||
(let [sym (scm/stx-datum ident)
|
||||
scopes (scm/stx-context ident)
|
||||
(let [sym (scm/syntax-e ident)
|
||||
scopes (scm/syntax-context ident)
|
||||
ss (store-scopes store sym)]
|
||||
(let [xs (nearest scopes ss)
|
||||
r (compare (count xs) 1)]
|
||||
@@ -93,4 +93,6 @@
|
||||
(throw (ex-info "unreachable" {})))
|
||||
(pos? r) (throw (ex-info "ambiguous sym" {:sym sym}))))))
|
||||
|
||||
(defn expand [stx env store-atom])
|
||||
(defn expand [stx env store-atom]
|
||||
(match (scm/syntax-e stx)
|
||||
(x :guard scm/constant?) x))
|
||||
Reference in new issue
Block a user