Liking cljdoc? Tell your friends :D

lucid.mind


.%clj/smacro

(.% 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"})
raw docstring

.%>clj/smacro

(.%> 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}]]
raw docstring

.&clj/smacro

(.& 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"
raw docstring

.*clj/smacro

(.* 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"])
raw docstring

.>clj/smacro

(.> 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"
raw docstring

.>nsclj/smacro

(.>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]
raw docstring

.>varclj/smacro

(.>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}
raw docstring

.?clj/smacro

(.? 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"]
raw docstring

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

× close