16
clojure “revenge of the verbs” [email protected] 2008-12-04

Clojure - Revenge of the Verbs

Embed Size (px)

Citation preview

Page 2: Clojure - Revenge of the Verbs

LISP

dynamic, functional, lazy

_not_ object-oriented

compiled (to JVM bytecode)

on-the-fly or ahead-of-time

Page 3: Clojure - Revenge of the Verbs

(def fibs (lazy-cat '(0 1) (map + fibs (drop 1 fibs))))

Page 4: Clojure - Revenge of the Verbs

Syntax

Page 5: Clojure - Revenge of the Verbs

Nothing nil

Booleans true false

Numbers 10 22.31 2/3

Page 6: Clojure - Revenge of the Verbs

Strings ”foo”

Characters \a \space \newline

Regexps #”[a-z]+”

Page 7: Clojure - Revenge of the Verbs

Comments ;this is a hack

Symbols foo namespace/foo java.util.BitSet

Keywords :foo :bar

Page 8: Clojure - Revenge of the Verbs

Lists (a b c)

Vectors [1 2 3]

Maps {:a 1 :b 2}

Sets #{:a :b :c}

Page 9: Clojure - Revenge of the Verbs

Semantics

Page 10: Clojure - Revenge of the Verbs

literals evaluate to themselves

vectors and maps are data

symbols are resolved

non-empty lists are calls

Page 11: Clojure - Revenge of the Verbs

calls (operator operands*)

special forms def if let fn

macros and defn time

functions + = str println

large sequence library

Page 12: Clojure - Revenge of the Verbs

Concurrency

Page 13: Clojure - Revenge of the Verbs

persistent data structures

“state - you’re doing it wrong”

lists, vectors, maps, sets ...

structural sharing

Page 14: Clojure - Revenge of the Verbs

Vars - thread-local

Refs - transactional

Agents - asynchronous

Page 15: Clojure - Revenge of the Verbs

Links

Page 16: Clojure - Revenge of the Verbs

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/