Skip to content

Files

Latest commit

Mar 4, 2017
4043257 · Mar 4, 2017

History

History
7 lines (4 loc) · 798 Bytes

assignment-by-destructuring.md

File metadata and controls

7 lines (4 loc) · 798 Bytes

#destructuring

Like some other languages (ruby, scala, python to an extent) clojure lets you selectively pull data from given data structures ― into variables at a level of elegance you would not know existed coming from e.g. Java. It is called destructuring because you take a given (and possibly nested!) data structure, and restructure its content into a set of other variables with a great sense of elegance.

You destructure to either re-organize a data structure into a differently structured one, or as firstly mentioned, to selectively pick stuff from a given data structure, elegantly. This ability is part of the core syntax of the language, not even requiring any explicit use of function calls.

To learn this by example, follow here.