You're viewing version 1.2.0 of ... The latest stable version of Clojure Core is 1.3.0.
1.2.0 Arrow_down_16x16
  • (.. x form)
  • (.. x form & more)
form => fieldName-symbol or (instanceMethodName-symbol args*)

Expands into a member access (.) of the first member on the first
argument, followed by the next member on the result, etc. For
instance:

(.. System (getProperties) (get "os.name"))

expands to:

(. (. System (getProperties)) (get "os.name"))

but is easier to write, read, and understand.

1 Example top

  • user> (.. "fooBAR" (toLowerCase) (contains "ooba"))
    true
    
    ;; use macroexpand to see how the form above will appear
    user> (macroexpand '(.. "fooBAR" (toLowerCase) (contains "ooba")))
    (. (. "fooBAR" (toLowerCase)) (contains "ooba"))
Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/core.clj:1266 top

(defmacro ..
  "form => fieldName-symbol or (instanceMethodName-symbol args*)

  Expands into a member access (.) of the first member on the first
  argument, followed by the next member on the result, etc. For
  instance:

  (.. System (getProperties) (get \"os.name\"))

  expands to:

  (. (. System (getProperties)) (get \"os.name\"))

  but is easier to write, read, and understand."
  {:added "1.0"}
  ([x form] `(. ~x ~form))
  ([x form & more] `(.. (. ~x ~form) ~@more)))
Vars in clojure.core/..: defmacro concat list seq

Comments top

No comments for ... Log in to add a comment.