Make calls! more reliable
This commit is contained in:
@@ -56,17 +56,18 @@
|
|||||||
[a]
|
[a]
|
||||||
(Array. true (into-array a) 1 (count a)))
|
(Array. true (into-array a) 1 (count a)))
|
||||||
|
|
||||||
|
(defn create-method-call
|
||||||
|
[[k v]]
|
||||||
|
(flatten (list (key->method k) (try (eval v)
|
||||||
|
(catch Exception _ v)))))
|
||||||
|
|
||||||
(defmacro call!
|
(defmacro call!
|
||||||
[obj k & args]
|
[obj k & args]
|
||||||
`(~(key->method k) ~obj ~@args))
|
`(~(key->method k) ~obj ~@args))
|
||||||
|
|
||||||
(defn calls!*
|
|
||||||
[[k v]]
|
|
||||||
(flatten (list (key->method k) (eval v))))
|
|
||||||
|
|
||||||
(defmacro calls!
|
(defmacro calls!
|
||||||
[obj & {:keys [] :as args}]
|
[obj & {:keys [] :as args}]
|
||||||
`(doto ~obj ~@(map calls!* args)))
|
`(doto ~obj ~@(map create-method-call args)))
|
||||||
|
|
||||||
(defmulti create-entity class)
|
(defmulti create-entity class)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user