clojure intro

Post on 10-May-2015

777 Views

Category:

Technology

0 Downloads

Preview:

Click to see full reader

DESCRIPTION

Brief Introduction to Clojure

TRANSCRIPT

Clojure Intro

Misha Kozik@mishadoff

Yet Another JVM Language?

Rationale

A Lisp for Functional Programming symbiotic with an Established Platform designed for Concurrency

                       ­ Rich Hickey

Clojure Philosophy

Clojure Philosophy

Lots of Irritating Stupid Parentheses

(defn concat [xs ys]  (if (empty? xs) ys      (let [[h & t] xs]        (cons h (concat t ys)))))

LISt Processing

(defn concat [xs ys]  (if (empty? xs) ys      (let [[h & t] xs]        (cons h (concat t ys)))))

LISt Processing

(defn concat [xs ys]  (if (empty? xs) ys      (let [[h & t] xs]        (cons h (concat t ys)))))

LISt Processing

(defn concat [xs ys]  (if (empty? xs) ys      (let [[h & t] xs]        (cons h (concat t ys)))))

(+ (* 2 5)     (/ 1 7))

 Prefix notation

  Do you speak it?

Syntax

Code Mode:

Data Mode:

Special Mode:

'(1 2 3 4)

(+ 1 2 3 4)

 (def a 42)

Quick Tour● Value● Function● Scope● List● Vector● Map● Set● Functional Features● Automatic Promotion● Destructuring● Loop/Recur● Time● Memoization● Lazy Sequences

● Threading macro● Meta● IO● Regexps● Record● Protocol● Type Hints● Multimethods● Exceptions● Macro● Concurrency● Java­>Clojure● Clojure­>Java● Bonus!

IDE

IDE

VimClojure

LightTable

Counter Clockwise

Enclojure

La Clojure

Infrastructure

●Leiningen, Clojars●Ring, Compojure, Enlive●ClojureScript●Pedestal●Seesaw●Datomic, Korma, Carmine, Monger●Overtone, Incanter●core.logic, core.match, core.async●AppEngine, Heroku●Write your own wrapper!

Books

Q?

top related