std.object.framework.access

get

added in 3.0

(get obj k)

accessor with either keyword or array lookup

(access/get (test.Cat. “spike”) :name) => “spike”

get-in

added in 3.0

(get-in obj ks)

accesses the nested object using specifiedb path

(access/get-in (test.Cat. “spike”) :name)

get-with-array

added in 3.0

(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) => {:name “spike”}

get-with-keyword

added in 3.0

(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”) :name) => “spike”

keys

added in 3.0

(keys obj)

gets all keys of an object

(access/keys (test.Cat. “spike”)) => (contains :name)

meta-clear

added in 3.0

(meta-clear class)

clears all meta-read and meta-write definitions for a class

set

added in 3.0

(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)) => (any “fluffy” (throws))

set-with-keyword

added in 3.0

(set-with-keyword obj k v)

sets the fields of an object with keyword

(std.object.framework/map-like test.Cat {:tag “cat” :read :all :write :all})

(-> (doto (test.Cat. “spike”) (set-with-keyword :name “fluffy”)) (access/get :name)) => (any “fluffy” (throws))