splice
function
rewrite-clj.zip/splice
(splice [zloc])Return zipper with the children of the current node in `zloc` merged into itself.
(akin to Clojure's `unquote-splicing` macro: `~@...`).
- if the node is not one that can have children, no modification will
be performed.
- if the node has no or only whitespace children, it will be removed.
- otherwise, splicing will be performed, moving the zipper to the first
non-whitespace spliced child node.
For example, given `[[1 2 3] 4 5 6]`, if zloc is located at vector `[1 2 3]`, a splice will result in raising the vector's children up `[1 2 3 4 5 6]` and locating the zipper at node `1`.
Examples
No examples yet. Be the first to add one!