Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
clojure
“revenge of the verbs”
       tim@lossen.de
        2008-12-04
LISP

  dynamic, functional, lazy

  _not_ object-oriented

compiled (to JVM bytecode)

  on-the-fly or ahead-of-time
(def fibs (lazy-cat '(0 1)
       (map + fibs (drop 1 fibs))))
Syntax
Nothing    nil

Booleans    true false

Numbers    10 22.31 2/3
Strings   ”foo”

Characters    a space newline

Regexps      #”[a-z]+”
Comments   ;this is a hack

Symbols foo namespace/foo
java.util.BitSet

Keywords   :foo :bar
Lists   (a b c)

Vectors    [1 2 3]

Maps      {:a 1 :b 2}

Sets    #{:a :b :c}
Semantics
literals evaluate to themselves

vectors and maps are data

symbols are resolved

non-empty lists are calls
calls    (operator operands*)

  special forms      def    if    let   fn

  macros      and    defn     time

  functions...
Concurrency
persistent data structures

  “state - you’re doing it wrong”

  lists, vectors, maps, sets ...

  structural sharing
Vars - thread-local

Refs - transactional

Agents - asynchronous
Links
Project   http://clojure.org

Presentations http://clojure.blip.tv

Book “Programming Clojure” (beta)
http://pragprog.com/...
Upcoming SlideShare
Loading in …5
×

Clojure - Revenge of the Verbs

4,169 views

Published on

Published in: Technology, Education
  • Be the first to comment

Clojure - Revenge of the Verbs

  1. 1. clojure “revenge of the verbs” tim@lossen.de 2008-12-04
  2. 2. LISP dynamic, functional, lazy _not_ object-oriented compiled (to JVM bytecode) on-the-fly or ahead-of-time
  3. 3. (def fibs (lazy-cat '(0 1) (map + fibs (drop 1 fibs))))
  4. 4. Syntax
  5. 5. Nothing nil Booleans true false Numbers 10 22.31 2/3
  6. 6. Strings ”foo” Characters a space newline Regexps #”[a-z]+”
  7. 7. Comments ;this is a hack Symbols foo namespace/foo java.util.BitSet Keywords :foo :bar
  8. 8. Lists (a b c) Vectors [1 2 3] Maps {:a 1 :b 2} Sets #{:a :b :c}
  9. 9. Semantics
  10. 10. literals evaluate to themselves vectors and maps are data symbols are resolved non-empty lists are calls
  11. 11. calls (operator operands*) special forms def if let fn macros and defn time functions + = str println large sequence library
  12. 12. Concurrency
  13. 13. persistent data structures “state - you’re doing it wrong” lists, vectors, maps, sets ... structural sharing
  14. 14. Vars - thread-local Refs - transactional Agents - asynchronous
  15. 15. Links
  16. 16. Project http://clojure.org Presentations http://clojure.blip.tv Book “Programming Clojure” (beta) http://pragprog.com/titles/shcloj TextMate Bundle http://github.com/ nullstyle/clojure-tmbundle/

×