O'Reilly logo

Learning ClojureScript by Allen Rohner, Rafik Naccache, W. David Jarvis

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Advanced destructuring and namespaces

In this section, we'll dig further into ClojureScript's destructuring syntax. We'll also learn about ClojureScript namespaces. If you're familiar with JavaScript ES6 modules, namespaces are sort of akin to that-they're essentially modules within which variable and function definitions are located and a collection of imported libraries can be defined, often with local bindings for convenience.

Destructuring

Destructuring in ClojureScript provides a way of binding values to local variables. We've already seen a few simple examples of how this works with the code in previous sections, but destructuring in ClojureScript is extremely powerful and so comprehensive that it's worth looking at some more advanced patterns ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required