You're viewing version 1.2.0 of down. The latest stable version of Clojure Core is 1.3.0.
1.2.0 Arrow_down_16x16
  • (down loc)
Returns the loc of the leftmost child of the node at this loc, or
nil if no children

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clojure/zip.clj:109 top

(defn down
  "Returns the loc of the leftmost child of the node at this loc, or
  nil if no children"
  {:added "1.0"}
  [loc]
    (when (branch? loc)
      (let [[node path] loc
            [c & cnext :as cs] (children loc)]
        (when cs
          (with-meta [c {:l [] 
                         :pnodes (if path (conj (:pnodes path) node) [node]) 
                         :ppath path 
                         :r cnext}] (meta loc))))))
Vars in clojure.zip/down: defn let meta when with-meta
Used in 0 other vars

Comments top

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