Liking cljdoc? Tell your friends :D

hara.core.base.mutable


cloneclj

(clone obj)

copyclj

(copy obj source)
(copy obj source ks)

sets the value of a given field

(-> (mutable/set -h- :name "cat") :name) => "cat"

sets the value of a given field

(-> (mutable/set -h- :name "cat")
    :name)
=> "cat"
raw docstring

defmutablecljmacro

(defmutable tp-name fields & protos)

allows definition of a mutable datastructure

(defmutable Hello [name value])

(def -h- (Hello. "dog" 1))

(get -h- :name) => "dog"

allows definition of a mutable datastructure

(defmutable Hello [name value])

(def -h- (Hello. "dog" 1))

(get -h- :name) => "dog"
raw docstring

fieldsclj

(fields obj)

setclj

(set obj m)
(set obj k v)

sets the value of a given field

(-> (mutable/set -h- :name "cat") :name) => "cat"

sets the value of a given field

(-> (mutable/set -h- :name "cat")
    :name)
=> "cat"
raw docstring

set-newclj

(set-new obj m)
(set-new obj k v)

sets the value of a given field only when it is nil

(-> (Hello. "cat" nil) (mutable/set-new :name "dog") :name) => (throws)

sets the value of a given field only when it is nil

(-> (Hello. "cat" nil)
    (mutable/set-new :name "dog")
    :name)
=> (throws)
raw docstring

updateclj

(update obj k f & args)

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close