Skip to content

Commit

Permalink
wip [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
borkdude committed Oct 3, 2024
1 parent 29bc890 commit d74e84b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 5 additions & 1 deletion src/sci/impl/analyzer.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -1801,6 +1801,9 @@
arr)
nil))))))

(defn analyze-interop-ifn [ctx v mv]
(prn :v))

;; This could be a protocol, but there's not a clear win in doing so:
;; https://github.com/babashka/sci/issues/848
(defn analyze
Expand All @@ -1812,7 +1815,6 @@
(constant? expr) (->constant expr)
(symbol? expr) (let [v (resolve/resolve-symbol ctx expr false (:tag m))
mv (meta v)]
(prn :mv mv)
(cond (constant? v) (->constant v)
(utils/var? v)
(if (and (vars/needs-ctx? v)
Expand All @@ -1829,6 +1831,8 @@
(sci.impl.types/->Node
(faster/deref-1 v)
nil))))
(:sci.impl.analyzer/interop-ifn mv)
(analyze-interop-ifn ctx v mv)
:else v))
;; don't evaluate records, this check needs to go before map?
;; since a record is also a map
Expand Down
5 changes: 2 additions & 3 deletions src/sci/impl/resolve.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
[sci.impl.records :as records]
[sci.impl.types :refer [->Node]]
[sci.impl.utils :as utils :refer [strip-core-ns
ana-macros]])
#?(:clj (:import [sci.impl Reflector])))
ana-macros]]))

(defn throw-error-with-location [msg node]
(utils/throw-error-with-location msg node {:phase "analysis"}))
Expand Down Expand Up @@ -73,7 +72,7 @@
(with-meta
[clazz #?(:clj sym-name
:cljs (.split (str sym-name) "."))]
{:sci.impl.analyzer/interop true})
{:sci.impl.analyzer/interop-ifn true})
#_(->Node
(interop/get-static-field clazz sym-name)
stack) #_(if (str/starts-with? (str sym-name) ".")
Expand Down

0 comments on commit d74e84b

Please sign in to comment.