Liking cljdoc? Tell your friends :D

hara.zip.base


add-historyclj

(add-history zip command)

adds elements to the zipper history

adds elements to the zipper history
raw docstring

bottom-most?clj

(bottom-most? zip)

check if at bottom-most point of a branch

(-> (zip/from-cursor '[1 2 [3 4 |]]) (bottom-most?)) => true

check if at bottom-most point of a branch

(-> (zip/from-cursor '[1 2 [3 4 |]])
    (bottom-most?))
=> true
raw docstring

delete-baseclj

(delete-base zip key op)

base delete helper

base delete helper
raw docstring

delete-leftclj

(delete-left {:keys [left] :as zip})
(delete-left zip num)

delete element/s left of the current position

(-> (zip/from-cursor '[1 2 | 3]) (delete-left) (zip/cursor)) => '([1 | 3])

delete element/s left of the current position

(-> (zip/from-cursor '[1 2 | 3])
    (delete-left)
    (zip/cursor))
=> '([1 | 3])
raw docstring

delete-rightclj

(delete-right {:keys [right] :as zip})
(delete-right zip num)

delete element/s right of the current position

(-> (zip/from-cursor '[1 2 | 3]) (delete-right) (zip/cursor)) => '([1 2 |])

delete element/s right of the current position

(-> (zip/from-cursor '[1 2 | 3])
    (delete-right)
    (zip/cursor))
=> '([1 2 |])
raw docstring

historyclj

(history zip)

accesses the zipper history

(-> (vector-zip [1 [2 3]]) (move-down) (move-right) (history)) => [[:down] [:right]]

accesses the zipper history

(-> (vector-zip [1 [2 3]])
    (move-down)
    (move-right)
    (history))
=> [[:down] [:right]]
raw docstring

insert-baseclj

(insert-base zip element key op)

base insert helper

base insert helper
raw docstring

insert-leftclj

(insert-left zip element)
(insert-left zip element & more)

insert element/s left of the current position

(-> (zip/from-cursor '[1 2 [[| 3] 4]]) (insert-left 1 2 3) (zip/cursor)) => '([1 2 [[1 2 3 | 3] 4]])

insert element/s left of the current position

(-> (zip/from-cursor '[1 2  [[| 3] 4]])
    (insert-left 1 2 3)
    (zip/cursor))
=> '([1 2 [[1 2 3 | 3] 4]])
raw docstring

insert-rightclj

(insert-right zip element)
(insert-right zip element & more)

insert element/s right of the current position

(-> (zip/from-cursor '[| 1 2 3]) (insert-right 1 2 3) (zip/cursor)) => '([| 3 2 1 1 2 3])

insert element/s right of the current position

(-> (zip/from-cursor '[| 1 2 3])
    (insert-right 1 2 3)
    (zip/cursor))
=> '([| 3 2 1 1 2 3])
raw docstring

left-most?clj

(left-most? zip)

check if at left-most point of a branch

(-> (zip/from-cursor [1 2 ['| 3 4]]) (left-most?)) => true

check if at left-most point of a branch

(-> (zip/from-cursor [1 2 ['| 3 4]])
    (left-most?))
=> true
raw docstring

left-nodeclj

(left-node zip)

element directly left of current position

(-> (zip/from-cursor '[1 2 3 | 4]) (left-node)) => 3

element directly left of current position

(-> (zip/from-cursor '[1 2 3 | 4])
    (left-node))
=> 3
raw docstring

left-nodesclj

(left-nodes zip)

all elements left of current position

(-> (zip/from-cursor '[1 2 | 3 4]) (left-nodes)) => '(1 2)

all elements left of current position

(-> (zip/from-cursor '[1 2 | 3 4])
    (left-nodes))
=> '(1 2)
raw docstring

move-bottom-mostclj

(move-bottom-most zip)

move to bottom-most point of current branch

(-> (zip/from-cursor '[1 2 | [[3] 4]]) (move-bottom-most) (zip/cursor)) => '([1 2 [[| 3] 4]])

move to bottom-most point of current branch

(-> (zip/from-cursor '[1 2 | [[3] 4]])
    (move-bottom-most)
    (zip/cursor))
=> '([1 2 [[| 3] 4]])
raw docstring

move-downclj

(move-down zip)
(move-down zip num)

move down from current position

(-> (zip/from-cursor '[1 2 | [3 4]]) (move-down) (zip/cursor)) => '([1 2 [| 3 4]])

move down from current position

(-> (zip/from-cursor '[1 2 | [3 4]])
    (move-down)
    (zip/cursor))
=> '([1 2 [| 3 4]])
raw docstring

move-down?clj

(move-down? zip)

check if can move down from current position

(-> (zip/from-cursor '[1 2 [3 4 |]]) (move-down?)) => false

(-> (zip/from-cursor '[1 2 | [3 4]]) (move-down?)) => true

check if can move down from current position

(-> (zip/from-cursor '[1 2 [3 4 |]])
    (move-down?))
=> false

(-> (zip/from-cursor '[1 2 | [3 4]])
    (move-down?))
=> true
raw docstring

move-leftclj

(move-left {:keys [left right] :as zip})
(move-left zip num)

move left from current position

(-> (zip/from-cursor '[1 2 [3 4 |]]) (move-left) (zip/cursor)) => '([1 2 [3 | 4]])

move left from current position

(-> (zip/from-cursor '[1 2 [3 4 |]])
    (move-left)
    (zip/cursor))
=> '([1 2 [3 | 4]])
raw docstring

move-left-mostclj

(move-left-most zip)

move to left-most point of current branch

(-> (zip/from-cursor '[1 2 [3 4 |]]) (move-left-most) (zip/cursor)) => '([1 2 [| 3 4]])

move to left-most point of current branch

(-> (zip/from-cursor '[1 2 [3 4 |]])
    (move-left-most)
    (zip/cursor))
=> '([1 2 [| 3 4]])
raw docstring

move-left?clj

(move-left? zip)

check if can move left from current position

(-> (zip/from-cursor '[1 2 [3 | 4]]) (move-left?)) => true

(-> (zip/from-cursor '[1 2 [| 3 4]]) (move-left?)) => false

check if can move left from current position

(-> (zip/from-cursor '[1 2 [3 | 4]])
    (move-left?))
=> true

(-> (zip/from-cursor '[1 2 [| 3 4]])
    (move-left?))
=> false
raw docstring

move-rightclj

(move-right {:keys [left right] :as zip})
(move-right zip num)

move right from current position

(-> (zip/from-cursor '[1 2 [| 3 4]]) (move-right) (zip/cursor)) => '([1 2 [3 | 4]])

move right from current position

(-> (zip/from-cursor '[1 2 [| 3 4]])
    (move-right)
    (zip/cursor))
=> '([1 2 [3 | 4]])
raw docstring

move-right-mostclj

(move-right-most zip)

move to right-most point of current branch

(-> (zip/from-cursor '[1 2 [| 3 4]]) (move-right-most) (zip/cursor)) => '([1 2 [3 4 |]])

move to right-most point of current branch

(-> (zip/from-cursor '[1 2 [| 3 4]])
    (move-right-most)
    (zip/cursor))
=> '([1 2 [3 4 |]])
raw docstring

move-right?clj

(move-right? zip)

check if can move right from current position

(-> (zip/from-cursor '[1 2 [3 | 4]]) (move-right?)) => true

(-> (zip/from-cursor '[1 2 [3 4 |]]) (move-right?)) => false

check if can move right from current position

(-> (zip/from-cursor '[1 2 [3 | 4]])
    (move-right?))
=> true

(-> (zip/from-cursor '[1 2 [3 4 |]])
    (move-right?))
=> false
raw docstring

move-top-mostclj

(move-top-most zip)

move to top-most point of the tree

(-> (zip/from-cursor '[1 2 [| 3 4]]) (move-top-most) (zip/cursor)) => '(| [1 2 [3 4]])

move to top-most point of the tree

(-> (zip/from-cursor '[1 2 [| 3 4]])
    (move-top-most)
    (zip/cursor))
=> '(| [1 2 [3 4]])
raw docstring

move-upclj

(move-up zip)
(move-up zip num)

move up from current position

(-> (zip/from-cursor '[1 2 [| 3 4]]) (move-up) (zip/cursor)) => '([1 2 | [3 4]])

move up from current position

(-> (zip/from-cursor '[1 2 [| 3 4]])
    (move-up)
    (zip/cursor))
=> '([1 2 | [3 4]])
raw docstring

move-up?clj

(move-up? zip)

check if can move up from current position

(-> (zip/from-cursor '[1 2 [3 4 |]]) (move-up?)) => true

check if can move up from current position

(-> (zip/from-cursor '[1 2 [3 4 |]])
    (move-up?))
=> true
raw docstring

replace-leftclj

(replace-left {:keys [left] :as zip} element)

replace element left of the current position

(-> (zip/from-cursor '[1 2 | 3]) (replace-left "10") (zip/cursor)) => '([1 "10" | 3])

replace element left of the current position

(-> (zip/from-cursor '[1 2 | 3])
    (replace-left "10")
    (zip/cursor))
=> '([1 "10" | 3])
raw docstring

replace-rightclj

(replace-right {:keys [right] :as zip} element)

replace element right of the current position

(-> (zip/from-cursor '[1 2 | 3]) (replace-right "10") (zip/cursor)) => '([1 2 | "10"])

replace element right of the current position

(-> (zip/from-cursor '[1 2 | 3])
    (replace-right "10")
    (zip/cursor))
=> '([1 2 | "10"])
raw docstring

right-most?clj

(right-most? zip)

check if at right-most point of a branch

(-> (zip/from-cursor '[1 2 [3 4 |]]) (right-most?)) => true

check if at right-most point of a branch

(-> (zip/from-cursor '[1 2 [3 4 |]])
    (right-most?))
=> true
raw docstring

right-nodeclj

(right-node zip)

element directly right of current position

(-> (zip/from-cursor '[1 2 3 | 4]) (right-node)) => 4

element directly right of current position

(-> (zip/from-cursor '[1 2 3 | 4])
    (right-node))
=> 4
raw docstring

right-nodesclj

(right-nodes zip)

all elements right of current position

(-> (zip/from-cursor '[1 2 | 3 4]) (right-nodes)) => '(3 4)

all elements right of current position

(-> (zip/from-cursor '[1 2 | 3 4])
    (right-nodes))
=> '(3 4)
raw docstring

seq-zipclj

(seq-zip root)

constructs a sequence zipper

(seq-zip '(1 2 3 4 5)) => (contains {:left (), :right '((1 2 3 4 5)), :parent :top})

constructs a sequence zipper

(seq-zip '(1 2 3 4 5))
=> (contains {:left (),
              :right '((1 2 3 4 5)),
              :parent :top})
raw docstring

siblingsclj

(siblings {:keys [left right] :as zip})

all elements left and right of current position

(-> (zip/from-cursor '[1 2 | 3 4]) (siblings)) => '(1 2 3 4)

(-> (zip/from-cursor '[1 [2 | 3] 4]) (siblings)) => '(2 3)

all elements left and right of current position

(-> (zip/from-cursor '[1 2 | 3 4])
    (siblings))
=> '(1 2 3 4)

(-> (zip/from-cursor '[1 [2 | 3] 4])
    (siblings))
=> '(2 3)
raw docstring

top-most?clj

(top-most? zip)

check if at top-most point of the tree

(-> (zip/from-cursor [1 2 [3 4 '|]]) (top-most?)) => false

(-> (zip/from-cursor '[1 2 [3 4 |]]) (move-up) (move-up) (top-most?)) => true

check if at top-most point of the tree

(-> (zip/from-cursor [1 2 [3 4 '|]])
    (top-most?))
=> false

(-> (zip/from-cursor '[1 2 [3 4 |]])
    (move-up)
    (move-up)
    (top-most?))
=> true
raw docstring

vector-zipclj

(vector-zip root)

constructs a vector based zipper

(vector-zip [1 2 3 4 5]) => (contains {:left (), :right '([1 2 3 4 5]) :parent :top})

constructs a vector based zipper

(vector-zip [1 2 3 4 5])
=> (contains {:left (),
              :right '([1 2 3 4 5])
              :parent :top})
raw docstring

zipperclj

(zipper root {:keys [branch? children make-node] :as meta})

constructs a zipper

(zipper '(1 2 3) {:branch? seq? :children identity :make-node identity}) => zipper?

constructs a zipper

(zipper '(1 2 3) {:branch?   seq?
                  :children  identity
                  :make-node identity})
=> zipper?
raw docstring

zipper-metaclj

(zipper-meta meta)

checks that the meta contains valid functions

(zipper-meta {}) => (throws)

(zipper-meta {:branch? seq? :children identity :make-node identity}) => map?

checks that the meta contains valid functions

(zipper-meta {})
=> (throws)

(zipper-meta {:branch?   seq?
              :children  identity
              :make-node identity})
=> map?
raw docstring

zipper?clj

(zipper? x)

checks to see if an object is a zipper

(zipper? 1) => false

checks to see if an object is a zipper

(zipper? 1)
=> false
raw docstring

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

× close