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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Samuel Flores
November 29, 2014
Programming
4
200
Clojure
Apresentando Clojure hoje no encontro do GuruPI
Samuel Flores
November 29, 2014
Tweet
Share
More Decks by Samuel Flores
See All by Samuel Flores
Introdução ao MRuby
samflores
1
59
Gulp.js
samflores
1
150
Por que Ruby?
samflores
1
150
Extendendo Ruby com C (& cartoons)
samflores
3
180
Sinatra
samflores
2
220
Other Decks in Programming
See All in Programming
Claude Code の Skill で複雑な既存仕様をすっきり整理しよう
yuichirokato
1
270
new(1.26) ← これすき / kamakura.go #8
utgwkk
0
1.6k
「ブロックテーマでは再現できない」は本当か?
inc2734
0
1.1k
日本だけで解禁されているアプリ起動の方法
ryunakayama
0
370
CSC307 Lecture 13
javiergs
PRO
0
310
Claude Code、ちょっとした工夫で開発体験が変わる
tigertora7571
0
200
社内規程RAGの精度を73.3% → 100%に改善した話
oharu121
13
7.5k
CopilotKit + AG-UIを学ぶ
nearme_tech
PRO
1
120
izumin5210のプロポーザルのネタ探し #tskaigi_msup
izumin5210
1
510
AI時代のソフトウェア開発でも「人が仕様を書く」から始めよう-医療IT現場での実践とこれから
koukimiura
0
130
受け入れテスト駆動開発(ATDD)×AI駆動開発 AI時代のATDDの取り組み方を考える
kztakasaki
2
520
文字コードの話
qnighy
43
17k
Featured
See All Featured
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.6k
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.2k
Claude Code のすすめ
schroneko
67
220k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
98
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.8k
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
120
Java REST API Framework Comparison - PWX 2021
mraible
34
9.2k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4k
Done Done
chrislema
186
16k
How GitHub (no longer) Works
holman
316
140k
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