(.% obj)
Lists class information (.% String) => (contains {:modifiers #{:instance :public :final :class}, :name "java.lang.String"})
Lists class information (.% String) => (contains {:modifiers #{:instance :public :final :class}, :name "java.lang.String"})
(.%> obj)
Lists the class and interface hierarchy for the class
(.%> String) => [java.lang.String [java.lang.Object #{java.io.Serializable java.lang.Comparable java.lang.CharSequence}]]
Lists the class and interface hierarchy for the class (.%> String) => [java.lang.String [java.lang.Object #{java.io.Serializable java.lang.Comparable java.lang.CharSequence}]]
(.& obj)
Allow transparent field access and manipulation to the underlying object.
(def a "hello") (def >a (.& a)) (keys >a) => (contains [:hash])
(do (>a :value (chars "world")) a) => "world"
Allow transparent field access and manipulation to the underlying object. (def a "hello") (def >a (.& a)) (keys >a) => (contains [:hash]) (do (>a :value (chars "world")) a) => "world"
(.* obj & selectors)
lists what methods could be applied to a particular instance
(.* "abc" :name #"^to") => ["toCharArray" "toLowerCase" "toString" "toUpperCase"]
(.* String :name #"^to") => (contains ["toString"])
lists what methods could be applied to a particular instance (.* "abc" :name #"^to") => ["toCharArray" "toLowerCase" "toString" "toUpperCase"] (.* String :name #"^to") => (contains ["toString"])
(.> obj)
(.> obj method)
(.> obj method & more)
Threads the first input into the rest of the functions. Same as ->
but
allows access to private fields using both :keyword
and .symbol
lookup:
(.> "abcd" :value String.) => "abcd"
(.> "abcd" .value String.) => "abcd"
(let [a "hello" _ (.> a (.value (chars "world")))] a) => "world"
Threads the first input into the rest of the functions. Same as `->` but allows access to private fields using both `:keyword` and `.symbol` lookup: (.> "abcd" :value String.) => "abcd" (.> "abcd" .value String.) => "abcd" (let [a "hello" _ (.> a (.value (chars "world")))] a) => "world"
(.>ns ns class & selectors)
extracts all class methods into its own namespace.
(map #(.sym %) (.>ns test.string String :private #"serial")) => '[serialPersistentFields serialVersionUID]
extracts all class methods into its own namespace. (map #(.sym %) (.>ns test.string String :private #"serial")) => '[serialPersistentFields serialVersionUID]
(.>var name [class method & selectors])
(.>var name objvec & more)
extracts a class method into a namespace.
(.>var hash-without [clojure.lang.IPersistentMap without])
(->> (eval '(clojure.repl/doc hash-without)) with-out-str string/split-lines (drop 2)) => ["[[clojure.lang.IPersistentMap java.lang.Object]]" " " "member: clojure.lang.IPersistentMap/without" "type: clojure.lang.IPersistentMap" "modifiers: instance, method, public, abstract"]
(eval '(hash-without {:a 1 :b 2} :a)) => {:b 2}
extracts a class method into a namespace. (.>var hash-without [clojure.lang.IPersistentMap without]) (->> (eval '(clojure.repl/doc hash-without)) with-out-str string/split-lines (drop 2)) => ["[[clojure.lang.IPersistentMap java.lang.Object]]" " " "member: clojure.lang.IPersistentMap/without" "type: clojure.lang.IPersistentMap" "modifiers: instance, method, public, abstract"] (eval '(hash-without {:a 1 :b 2} :a)) => {:b 2}
(.? obj & selectors)
queries the java view of the class declaration
(.? String #"^c" :name) => (contains ["charAt"]) ;;["charAt" "chars" "checkBoundsBeginEnd" ;; "checkBoundsOffCount" "checkIndex" "checkOffset" ;; "codePointAt" "codePointBefore" "codePointCount" "codePoints" ;; "coder" "compareTo" "compareToIgnoreCase" "concat" "contains" ;; "contentEquals" "copyValueOf"]
queries the java view of the class declaration (.? String #"^c" :name) => (contains ["charAt"]) ;;["charAt" "chars" "checkBoundsBeginEnd" ;; "checkBoundsOffCount" "checkIndex" "checkOffset" ;; "codePointAt" "codePointBefore" "codePointCount" "codePoints" ;; "coder" "compareTo" "compareToIgnoreCase" "concat" "contains" ;; "contentEquals" "copyValueOf"]
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close