lazy-map.core

Create lazy-maps, whose values are only calculated when they are looked up for the first time, see lazy-map

->LazyMap

(->LazyMap contents)

Positional factory function for class lazy_map.core.LazyMap.

Holder

protocol

Hold a value.

members

getv

(getv a)

Return object, resolving it if delayed.

lazy-map

macro

(lazy-map m)

Return a LazyMap created from a map m. The values in m are only evaluated when accessed.

user> (def my-map
        (lazy-map
         {:cause (do (println "Getting Cause")
                     :major-failure)
          :name (do (println "Getting Name")
                    "Some Name")}))
#'user/my-map

user> (:name my-map)
Getting Name
"Some Name"

user> (:name my-map)
"Some Name"