Book Image

Learning ClojureScript

By : W. David Jarvis, Allen Rohner
Book Image

Learning ClojureScript

By: W. David Jarvis, Allen Rohner

Overview of this book

Clojure is an expressive language that makes it possible to easily tackle complex software development challenges. Its bias toward interactive development has made it a powerful tool, enabling high developer productivity. In this book, you will first learn how to construct an interactive development experience for ClojureScript.. You will be guided through ClojureScript language concepts, looking at the basics first, then being introduced to advanced concepts such as functional programming or macro writing. After that, we elaborate on the subject of single page web applications, showcasing how to build a simple one, then covering different possible enhancements. We move on to study more advanced ClojureScript concepts, where you will be shown how to address some complex algorithmic cases. Finally, you'll learn about optional type-checking for your programs, how you can write portable code, test it, and put the advanced compilation mode of the Google Closure Compiler to good use.
Table of Contents (15 chapters)
Learning ClojureScript
About the Authors
About the Reviewer

Chapter 2. ClojureScript Language Fundamentals

ClojureScript provides the developer with great expressive power, thanks to its elegant semantics and its bias toward functional programming-both artifacts of its heritage as a Lisp language.

It also encourages the use of a minimal set of pragmatic and efficient data structures that make it possible to productively write data-oriented programs that are bound by a set of unified operations, typically conforming to the powerful seq abstraction.

In this chapter, we are going to explore these semantics and data structures so that we can gain a deep knowledge of the ClojureScript language basics. We'll delve into its basic scalar types and collections, understand how expression evaluation and variable scoping work, study the seq abstraction along with the concept of laziness, and show how interoperability with JavaScript works. We'll be covering the following topics:

  • Understanding ClojureScript functions

  • ClojureScript data structures

  • Advanced destructuring...