Liking cljdoc? Tell your friends :D

shuriken.destructure

### Destructuring destructuring forms
raw docstring

deconstructclj

(deconstruct binding-form)

Returns a flat sequence of the symbols bound in the binding-form in depth-first order.

(deconstruct '[a & {:keys [x] y :_y :or {x 1} :as m}])
=> '[a x y m]
Returns a flat sequence of the symbols bound in the binding-form
in depth-first order.

```clojure
(deconstruct '[a & {:keys [x] y :_y :or {x 1} :as m}])
=> '[a x y m]
```
sourceraw docstring

disentangleclj

(disentangle binding-form)

Parses one level of destructuring.

(disentangle '[a b & [c]])
=> '{:items [a b], :more [c]}

(disentangle '{:keys [a] b :b [c1 c2] :c :or {d 1} :as m})
=> '{:items [a b [c1 c2]],
     :as m,
     :or {d 1},
     :mapping {a :a, b :b, [c1 c2] :c}}
Parses one level of destructuring.

```clojure
(disentangle '[a b & [c]])
=> '{:items [a b], :more [c]}

(disentangle '{:keys [a] b :b [c1 c2] :c :or {d 1} :as m})
=> '{:items [a b [c1 c2]],
     :as m,
     :or {d 1},
     :mapping {a :a, b :b, [c1 c2] :c}}
```
sourceraw docstring

restructureclj

(restructure binding-form mapping)

Undoes what destructure does.

(restructure [x & {:keys [a b] c :cc d :d :or {d 3}}]
             {x 0 a 1 b 2 c 3})
=> [0 :a 1 :b 2 :cc 3 :d nil]
Undoes what destructure does.

```clojure
(restructure [x & {:keys [a b] c :cc d :d :or {d 3}}]
             {x 0 a 1 b 2 c 3})
=> [0 :a 1 :b 2 :cc 3 :d nil]
```
sourceraw docstring

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

× close