File tree Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Original file line number Diff line number Diff line change
1
+ (ns applied-science.js-interop
2
+ (:refer-clojure :exclude [defn get get-in fn let select-keys assoc!]))
3
+
4
+ (defmacro lit [x] x )
5
+
6
+ (defmacro defn [& body]
7
+ `(clojure.core/defn ~@body))
8
+
9
+ (defmacro get-in [& body]
10
+ `(clojure.core/get-in ~@body))
11
+
12
+ (defmacro fn [& body]
13
+ `(clojure.core/fn ~@body))
14
+
15
+ (defmacro let [& body]
16
+ `(clojure.core/let ~@body))
17
+
18
+ (defmacro call-in [obj path & fs]
19
+ `(.. ~obj ~@(map #(symbol (str " -" %)) path) ~@(map list fs)))
20
+
21
+ (defmacro call [obj f & args]
22
+ (list* (symbol (str " ." (name f))) obj args))
23
+
24
+ (defmacro !set [obj k v]
25
+ `(do (cljs.core/set! ~(list (symbol (str " .-" (name k))) obj) ~v)
26
+ ~obj))
27
+
28
+ (defmacro extend! [obj other]
29
+ `(js/Object.assign ~obj ~other))
30
+
31
+ (defmacro push! [obj v]
32
+ `(doto ~obj
33
+ (.push ~v)))
34
+
35
+ (defmacro select-keys [obj ks]
36
+ `(clojure.core/select-keys ~obj ~ks))
37
+
38
+ (defmacro assoc! [& body]
39
+ `(clojure.core/assoc! ~@body))
40
+
41
+ (defmacro obj [& body]
42
+ `(cljs.core/js-obj ~@body))
43
+
44
+ (defmacro get [& body]
45
+ `(cljs.core/get ~@body))
You can’t perform that action at this time.
0 commit comments