clj->extern

This commit is contained in:
Scott Richmond 2023-11-25 14:27:49 -05:00
parent fd77e1ed45
commit 246e9e5e53

View File

@ -241,14 +241,14 @@
:cljs (.bind (o/get js/window str) js/window) :cljs (.bind (o/get js/window str) js/window)
)) ))
(def clj {:name "clj" (def extern {:name "extern"
::data/type ::data/clj ::data/type ::data/clj
:body (fn [& args] :body (fn [& args]
(println "Args passed: " args) ;(println "Args passed: " args)
(let [called (-> args first strpart readstr resolve-str) (let [called (-> args first strpart readstr resolve-str)
fn-args (rest args)] fn-args (rest args)]
(println "Fn: " called) ;(println "Fn: " called)
(println "Args: " (clj->js fn-args)) ;(println "Args: " (clj->js fn-args))
#?( #?(
:clj(apply called fn-args) :clj(apply called fn-args)
:cljs (.apply called js/window (clj->js fn-args)))))}) :cljs (.apply called js/window (clj->js fn-args)))))})
@ -281,7 +281,7 @@
"conj" conj- "conj" conj-
"get" get- "get" get-
"type" type- "type" type-
"clj" clj "extern" extern
"first" first- "first" first-
"rest" rest- "rest" rest-
"nth" nth- "nth" nth-