1.3.0 permalink Arrow_down_16x16

lefts

clojure.zip

  • (lefts loc)
Returns a seq of the left siblings of this loc

1 Example top

  • (def vz (vector-zip [1 2 3 4 5]))
    
    ;; root
    ;;  |________
    ;;  | | | | |
    ;;  1 2[3]4 5
    
    ;;go down and then right twice, what's to the left of me now?
    (-> vz down right right lefts)
    =>(1 2)
    
    ;;equivalent:
    (-> vz down right right rights)
    =>(4 5)
    
    
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:96 top

(defn lefts
  "Returns a seq of the left siblings of this loc"
  {:added "1.0"}
  [loc]
    (seq (:l (loc 1))))
Vars in clojure.zip/lefts:
Used in 0 other vars

Comments top

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