Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Clojure Introduction.

Clojure Introduction.

Lauro Caetano

January 14, 2014
Tweet

More Decks by Lauro Caetano

Other Decks in Programming

Transcript

  1. • Intro (Syntax, Data Structures, Functions) • Persistent Data Structures

    • Macros • Famous projects • Should I use Clojure? • Learn more.
  2. • Clojure is a dynamic programming language that targets the

    Java Virtual Machine. • Clojure is a dialect of Lisp (code as data). • Functional (features a rich set of immutable, persistent data structure). • When mutable state is needed, Clojure offers a software transactional memory system and reactive Agent system that ensure clean, correct, multithreaded designs.
  3. • Maps are similar to dictionaries or hashes in other

    languages. They are a way of associating some value with some other value.
  4. • Lists are similar to vector in that they are

    linear collections of values.
  5. • While persistence can be achieved by simple copying, this

    is inefficient in CPU and RAM usage, because most operations make only small changes to a data structure.
  6. • A better method is to exploit the similarity between

    the new and old versions to share structure between them, such as using the same subtree in a number of tree structures. • (Fat Node, Path Copying, A combination)
  7. • Macro is a tool for transforming an arbitrary data

    structure into one which can be evaluated by Clojure. (Allows new syntax)
  8. • Learn. • Improve the way you write code in

    other languages. • Motivation.
  9. • References • https://github.com/clojure/clojure • clojure.org • http://en.wikipedia.org/wiki/ Persistent_data_structure •

    http://www.braveclojure.com/ • http://www.infoq.com/presentations/Value- Identity-State-Rich-Hickey