1.18k likes | 1.39k Views
Clojure in the Cloud. JavaOne. Sept. 29, 2014 @ 12: 3 0 p m. Everett Toews Developer Advocate @ everett_toews. Intro. Developer. PMC and Committer on Apache jclouds. Intro. Advocate. Intro. Operations. Co-author of The OpenStack Ops Guide. docs.openstack.org /ops. Clojure.
E N D
Clojurein the Cloud JavaOne Sept. 29, 2014 @ 12:30 pm Everett Toews Developer Advocate @everett_toews
Intro Developer
Intro Advocate
Intro Operations
Co-author of The OpenStack Ops Guide docs.openstack.org/ops
Clojure List
Clojure Vector
Clojure Map
{:key1"value1" :key2 "value2"}
Clojure Parens
(fn arg1 arg2) (sfarg1 arg2)
Clojure Prefix
(+ 2 3) ; 5
Clojure Functional
(defnadd-7 [x] (+ x 7))
(add-7 3) ; 10
(map add-7 [2 3]) ; (9 10)
Clojure Types
(add-7"3") ; ClassCastExceptionjava.lang.String cannot be cast to java.lang.Number
Clojure Destructuring
1 (defn print-args 2 [f & rest] 3 (println f) 4 (println 5 (apply sorted-map rest)))
(print-args"first" :k3 "v3" :k1 "v1" :k2 "v2") ; first ; {:k1 v1, :k2 v2, :k3 v3}
Clojure Lambda
(map (fn [x] (+ x 7)) [2 3]) ; (9 10)
Clojure Macro
(defmacro when [test & body] (list 'if test (cons 'do body)))
Clojure lein
lein new app github-comment-clj lein clean lein install lein test lein run leinrepl
Clojure REPL
Read Eval Print Loop
Cloud SaaS
Cloud IaaS
Cloud Resources Accessible Via HTTP API
HTTP APIs Documentation
HTTP APIs Logging
HTTP APIs Auth
HTTP APIs Endpoint
HTTP APIs Environment
HTTP APIs Connect!