Skip to main content

slurp-backward-fully-into

function

rewrite-clj.paredit/slurp-backward-fully-into

(slurp-backward-fully-into [zloc] [zloc opts])
Returns `zloc` with all left sibling nodes of nearest eligible sequnece slurped into that sequence else `zloc` See also [[slurp-backward-into]]. Optional `opts` specify: - `:from` - `:parent` (default) starts search from parent of `zloc` then upward - `:current` starts search from `zloc` then upward to allow slurping into empty sequences Generic behavior: - `1 [2 3 [4 |5 6] 7] => 1 [[2 3 4 |5 6] 7]` Slurp from parent - `1 [2 3 [[|4 5]]] => 1 [[[2 3 |4 5]]]` Slurp from ancestor With `:from :current`: - `1 2 [3 4 |[] 5] => 1 2 [|[3 4] 5]` Slurp into current empty sequence - `1 2 [|[3 4] 5] => [|[1 2 3 4] 5]` Slurp into current non-empty sequence With `:from :parent` (default): - `1 2 [[|[]] 3 4] => [[1 2 |[] 2 3]` Slurp into parent

No examples yet. Be the first to add one!