(get obj k)
accessor with either keyword or array lookup
(access/get (test.Cat. "spike") :name) => "spike"
accessor with either keyword or array lookup (access/get (test.Cat. "spike") :name) => "spike"
(get-with-array obj arr)
access the fields of an object with an array of keywords
(get-with-array {:a 1} [:a]) => {:a 1}
(get-with-array (test.Cat. "spike") [:name :species]) => {:name "spike", :species "cat"}
access the fields of an object with an array of keywords (get-with-array {:a 1} [:a]) => {:a 1} (get-with-array (test.Cat. "spike") [:name :species]) => {:name "spike", :species "cat"}
(get-with-keyword obj k)
access the fields of an object with keyword
(get-with-keyword {:a 1} :a) => 1
(get-with-keyword (test.Cat. "spike") :species) => "cat"
access the fields of an object with keyword (get-with-keyword {:a 1} :a) => 1 (get-with-keyword (test.Cat. "spike") :species) => "cat"
(set obj m)
(set obj k v)
sets the fields of an object with a map
(-> (doto (test.Cat. "spike") (access/set {:name "fluffy"})) (access/get :name)) => "fluffy"
sets the fields of an object with a map (-> (doto (test.Cat. "spike") (access/set {:name "fluffy"})) (access/get :name)) => "fluffy"
(set-with-keyword obj k v)
sets the fields of an object with keyword
(-> (doto (test.Cat. "spike") (set-with-keyword :name "fluffy")) (access/get :name)) => "fluffy"
sets the fields of an object with keyword (-> (doto (test.Cat. "spike") (set-with-keyword :name "fluffy")) (access/get :name)) => "fluffy"
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close