Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Clojure
Search
Samuel Flores
November 29, 2014
Programming
200
4
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Clojure
Apresentando Clojure hoje no encontro do GuruPI
Samuel Flores
November 29, 2014
More Decks by Samuel Flores
See All by Samuel Flores
Introdução ao MRuby
samflores
1
60
Gulp.js
samflores
1
150
Por que Ruby?
samflores
1
160
Extendendo Ruby com C (& cartoons)
samflores
3
190
Sinatra
samflores
2
230
Other Decks in Programming
See All in Programming
Contextとはなにか
chiroruxx
1
370
さぁV100、メモリをお食べ・・・
nilpe
0
160
エージェンティックRAGにAWSで入門しよう!
har1101
9
1.8k
AI時代のUIはどこへ行く?その2!
yusukebe
22
7.5k
ローカルLLMを使ってB2Bサービスを作っていての学び
yaotti
0
220
Strategic Design in the Frontend: Moduliths & Micro Frontends @DDDEurope
manfredsteyer
PRO
0
130
AI 輔助遺留系統現代化的經驗分享
jame2408
1
1k
A2UI という光を覗いてみる
satohjohn
1
160
SREは、MCPとSRE Agentをこう使え!
kazumax55
0
120
気づいたらRubyで100作品 ー クリエイティブコーディングが生活の一部になるまで / 100 Ruby Sketches Later: How Creative Coding Became Part of My Life
chobishiba
3
610
Agentic UI
manfredsteyer
PRO
0
200
代数的データ型って何が嬉しいの? #frontend_phpcon_do
kajitack
8
3.8k
Featured
See All Featured
Paper Plane
katiecoart
PRO
1
52k
Tell your own story through comics
letsgokoyo
1
970
Designing for humans not robots
tammielis
254
26k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.5k
New Earth Scene 8
popppiees
3
2.4k
The Limits of Empathy - UXLibs8
cassininazir
1
370
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
370
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
220
Un-Boring Meetings
codingconduct
0
320
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
440
Building Adaptive Systems
keathley
44
3.1k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
250
Transcript
(Clojure) @samflores
Lisp
Lots of InSignificant Parenthesis
LISt Processing
(1 2 3) *
Homoiconicidade
(+ 2 3) ; 5
(+ 2 4 6) ; 12
(doc +) clojure.core/+ ([] [x] [x y] [x y &
more]) Returns the sum of nums. (+) returns 0. Does not auto-promote longs, will throw on overflow. See also: +'
Funcional
(odd? 2) ; false
(def par? (fn [n] (even? n))) (par? 2); true
(def par? even?) (par? 2); true
(defn greet [name] (str "Hello, " name)) (greet "John"); Hello,
John
(map :name [{:name "John" :age 15} {:name "Mary" :age 10}])
(reduce + (range 10))
(apply + (repeat 30 8)) ; 240
(def dobra (partial * 2)) (dobra 5) ; 10
Simplicidade
def fn #() if do let quote ‘() var #’()
loop recur throw try formas especiais
alias and BEGIN begin break case class def defined? do
else elsif END end ensure for if in module next not or redo rescue retry return self super then undef unless until when while yield Ruby
assert break class const continue default do double else enum
extends final finally float for goto if implements import instanceof int interface long native new package private protected public return short static strictfp super switch synchronized this throw throws transient try void volatile while Java
Pragmatismo
(def b 2r101010) (def n 1337N) (def m 3.14159M) (def
r #"(\d+)") data types
(def l '(1 2 3)) (def v [1 2 3])
(def m {:a 1 :b 2}) (def s #{:x :y :z}) data types
JVM*
(def today (java.Util.Date.)) (.year today) ; today.year() (Integer/parseInt "10") Java
interop
Imutabilidade*
(def l '(1)) (conj l 2) (prn l) ; (1)
& Concorrência Paralelismo
STM atoms agents delays futures promisses refs core.async …
(def l (atom [])) (swap! l conj 1) atoms
(def c (agent 0)) (send c inc) (send c dec)
(await c) agents
(defn long-running-job [n] (Thread/sleep 3000) (+ n 10)) (pmap long-running-job
(range 100)) pmap
(def ch (chan)) (go (print (<! ch))) (put! ch "Hi")
core.async
Environment
(defroute "/" [] (home-handler)) (defroute "/:user” [user] (profile-handler user)) compojure
:dependencies [[org.clojure/clojure "1.6.0"] [org.clojure/core.async "0.1.346.0-17112a-alpha"]] leiningen
$ lein deps $ lein ring server leiningen
(select user (with address) (fields :firstName :lastName :address.state) (where {:email
"
[email protected]
"})) korma
ClojureScript core.typed datomic Clojars jetty http-kit …
Comunidade
clojure.org clojure-doc.org clojuredocs.org grimoire.arrdem.com #clojure FreeNode
(obrigado) @samflores