Liking cljdoc? Tell your friends :D

lucid.insight.util


keep-varsclj

(keep-vars vars namespaces)
(keep-vars vars namespaces coerce)

keeps the vars that are in the set of namespace

(keep-vars '#{x.y/a x.z/b} '#{x.y}) => '#{x.y/a}

keeps the vars that are in the set of namespace

(keep-vars '#{x.y/a x.z/b} '#{x.y})
 => '#{x.y/a}
raw docstring

keywordize-keysclj

(keywordize-keys m)

modifies the keys of a map to be a keyword

(keywordize-keys {"a" 1 "b" 2}) => {:b 2, :a 1}

modifies the keys of a map to be a keyword

(keywordize-keys {"a" 1 "b" 2})
=> {:b 2, :a 1}
raw docstring

(keywordize-links m)

modifies the keys of a map to be a keyword

(keywordize-links {"a" #{"c" "d"} "b" #{"e"}}) => {"b" #{:e}, "a" #{:c :d}}

modifies the keys of a map to be a keyword

(keywordize-links {"a" #{"c" "d"} "b" #{"e"}})
=> {"b" #{:e}, "a" #{:c :d}}
raw docstring

namespace?clj

(namespace? var namespaces)
(namespace? var namespaces coerce)

figures out if the var is in one of the listed namespaces

(namespace? 'example.core/hello #{}) => false

(namespace? 'example.core/hello '#{example.core}) => true

figures out if the var is in one of the listed namespaces

(namespace? 'example.core/hello #{})
=> false

(namespace? 'example.core/hello '#{example.core})
=> true
raw docstring

reverse-graphclj

(reverse-graph graph)

takes a call-graph and reverses the visulization of call

(def calls {:a #{:b :c :d} :b #{:c} :c #{:a} :d #{}})

(reverse-graph calls) => {:a #{:c}, :d #{:a}, :b #{:a}, :c #{:b :a}}

(-> calls reverse-graph reverse-graph) => calls

takes a call-graph and reverses the visulization of call

(def calls {:a #{:b :c :d}
            :b #{:c}
            :c #{:a}
            :d #{}})

(reverse-graph calls)
=> {:a #{:c}, :d #{:a}, :b #{:a}, :c #{:b :a}}

(-> calls reverse-graph reverse-graph)
=> calls
raw docstring

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

× close