Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Introduction to Clojure
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Julian Espinel
March 01, 2014
Programming
75
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Introduction to Clojure
Spanish version
Julian Espinel
March 01, 2014
More Decks by Julian Espinel
See All by Julian Espinel
Deploy and monitor an application with Docker
julianespinel
0
85
Building a microservice
julianespinel
0
75
Microservices
julianespinel
1
75
Autheo
julianespinel
1
180
Other Decks in Programming
See All in Programming
カツオ、ご期待ください
suneo3476
0
160
速習iPhone Duo対応
yuukiw00w
2
970
Are APIs Still Relevant in the AI Era?
soyuka
0
440
sbt 2.0: takeoff
eed3si9n
0
110
Verilogで学ぶCPU自作入門
uyuki234
8
4.1k
Embedded Swiftで作る自作USBデバイス によるiOSデバイスの自動テスト / iOSDC Japan 2026 glassfiber
glassfiber
0
310
mrbgem 三角測量 開発
ogom
0
220
[ハンズオン]AIへの指示だけで「五目並べ」を作ってみよう
satoshi256kbyte
1
360
re:Inventに行く前に知っておきたい現地参加のノウハウ
nokomoro3
0
390
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
530
Kubernetes祭り #2 OP/ED
bells17
0
110
自サークルのIdPからログアウトできるようになるまで
taiseiue
1
130
Featured
See All Featured
Designing for Performance
lara
612
70k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
270
Why Our Code Smells
bkeepers
PRO
340
58k
The Pragmatic Product Professional
lauravandoore
37
7.5k
Exploring anti-patterns in Rails
aemeredith
4
530
Darren the Foodie - Storyboard
khoart
PRO
4
4k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
550
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
370
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
20k
Paper Plane (Part 1)
katiecoart
PRO
2
11k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.6k
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
2
400
Transcript
Introducción a Clojure Implementando un API REST
Agenda 1. ¿Qué es Clojure? 2. Conceptos básicos 3. ¿Por
qué aprender Clojure? 4. ¿Qué necesito para programar? 5. Sintaxis del lenguaje 6. API REST en Clojure 7. Parte final 8. Fuentes
Agenda 1. ¿Qué es Clojure? 2. Conceptos básicos 3. ¿Por
qué aprender Clojure? 4. ¿Qué necesito para programar? 5. Sintaxis del lenguaje 6. API REST en Clojure 7. Parte final 8. Fuentes
1. ¿Qué es Clojure? Piet Mondrian Composition II in Red,
Blue, and Yellow 1930
1. ¿Qué es Clojure? Rich Hickey Clojure programming language 2007
1. ¿Qué es Clojure? 1. Lenguaje de programación
1. ¿Qué es Clojure? 1. Lenguaje de programación
1. ¿Qué es Clojure? 1. Lenguaje de programación Permite side
effects (acceso a la base de datos, consumo de servicios externos, etc.) Idealmente se debe programar sin side effects. Ejemplo función impura.
1. ¿Qué es Clojure? 1. Lenguaje de programación Ejemplo función
pura.
Agenda 1. ¿Qué es Clojure? 2. Conceptos básicos 3. ¿Por
qué aprender Clojure? 4. ¿Qué necesito para programar? 5. Sintaxis del lenguaje 6. API REST en Clojure 7. Parte final 8. Fuentes
2. Conceptos básicos 1. Paradigma programación funcional 2. Concepto: Code
as data 3. Programación concurrente
2. Conceptos básicos Paradigma programación funcional 1. Estructuras de datos
inmutables.
2. Conceptos básicos Paradigma programación funcional 2. Funciones como “First-class
citizens”. (map inc [1 2 3 4 5]) -> (2 3 4 5 6)
2. Conceptos básicos Code as data
2. Conceptos básicos Programación concurrente
2. Conceptos básicos Programación concurrente 3. Refs (STM) 4. Futures
5. Promises
2. Conceptos básicos (Resumen) • Estructuras de datos inmutables. (Se
pueden compartir entre threads). • Funciones como elementos de primer orden. • “Construcciones” propias del lenguaje para el manejo de concurrencia.
Agenda 1. ¿Qué es Clojure? 2. Conceptos básicos 3. ¿Por
qué aprender Clojure? 4. ¿Qué necesito para programar? 5. Sintaxis del lenguaje 6. API REST en Clojure 7. Parte final 8. Fuentes
3. ¿Por qué aprender Clojure? “A language that doesn't affect
the way you think about programming, is not worth knowing.” Alan Perlis.
3. ¿Por qué aprender Clojure?
3. ¿Por qué aprender Clojure?
3. ¿Por qué aprender Clojure?
3. ¿Por qué aprender Clojure? Piet Mondrian Composition II in
Red, Blue, and Yellow 1930 Minimalismo
3. ¿Por qué aprender Clojure? Clojure es un lenguaje minimalista
Sintaxis: simple limitada consistente
Agenda 1. ¿Qué es Clojure? 2. Conceptos básicos 3. ¿Por
qué aprender Clojure? 4. ¿Qué necesito para programar? 5. Sintaxis del lenguaje 6. API REST en Clojure 7. Parte final 8. Fuentes
4. ¿Qué necesito para programar?
4. ¿Qué necesito para programar? Leiningen Herramienta de automatización de
proyectos escritos en Clojure.
Agenda 1. ¿Qué es Clojure? 2. Conceptos básicos 3. ¿Por
qué aprender Clojure? 4. ¿Qué necesito para programar? 5. Sintaxis del lenguaje 6. API REST en Clojure 7. Parte final 8. Fuentes
5. Sintaxis del lenguaje ¿Este es el lenguaje con muchos
paréntesis? LISP: LISt Processing
5. Sintaxis del lenguaje 1. Expresiones S: “Code as data”
2. Prefix notation (+ 1 2) (+ 1 2 3 4 5) -> 3 -> 15
5. Sintaxis del lenguaje 3. Packages Namespaces (ns bog.jvm.meetup) ¿Cómo
declaro una clase? ¿Cómo declaro una variable? ¿Cómo declaro un método?
5. Sintaxis del lenguaje 4. Clases Estructuras de datos mapas
{:key value} (assoc {} :key1 “value1” :key2 “value2”) -> {:key1 “value1” :key2 “value2”}
5. Sintaxis del lenguaje 4. Clases Estructuras de datos a.
deftype b. defrecord c. reify
5. Sintaxis del lenguaje 4. Estructuras de datos clojure.core •
nil • Char • Numbers • String
5. Sintaxis del lenguaje 4. Estructuras de datos clojure.core •
Set • List • Vector • Map
5. Sintaxis del lenguaje 5. Variables Valores inmutables (def nombre-valor
valor) (def hello-world “Hello world”) hello-world -> Hello world
5. Sintaxis del lenguaje 5. Valores inmutables (def basic-map {})
(def hello-world “Hello world”) (assoc basic-map :message hello-world) -> {:message “Hello world”}
5. Sintaxis del lenguaje 6. Métodos Funciones a. Declarar una
función: (defn nombre-funcion “documentacion” [lista-de-parametros] cuerpo-funcion)
5. Sintaxis del lenguaje 6. Funciones b. Llamar una función:
(nombre-funcion lista-de-parametros)
5. Sintaxis del lenguaje 6. Funciones
5. Sintaxis del lenguaje 6. Funciones Arity overloading Parámetros opcionales
5. Sintaxis del lenguaje Code as data (extra)
Agenda 1. ¿Qué es Clojure? 2. Conceptos básicos 3. ¿Por
qué aprender Clojure? 4. ¿Qué necesito para programar? 5. Sintaxis del lenguaje 6. API REST en Clojure 7. Parte final 8. Fuentes
6. API REST en Clojure 1. REST El ejemplo es
REST nivel 2
6. API REST en Clojure 2. Aplicación Directorio de servicios
6. API REST en Clojure 2. Aplicación HTTP request HTTP
response Front-end Back-end
6. API REST en Clojure 3. Estructura del código back-end
Servicios Estructuras de datos Persistencia Infraestructura
6. API REST en Clojure 4. Pruebas e integración continua
Midje & Midje &
6. API REST en Clojure 5. Nombramiento de archivos Mejores
prácticas de Clojure: a. minusculas b. palabras separadas por - ej: horario-api.clj, citas-api.clj
6. API REST en Clojure 5. Nombramiento de archivos horario-api.clj
-> horario_api.clj Interoperabilidad con Java
Agenda 1. ¿Qué es Clojure? 2. Conceptos básicos 3. ¿Por
qué aprender Clojure? 4. ¿Qué necesito para programar? 5. Sintaxis del lenguaje 6. API REST en Clojure 7. Parte final 8. Fuentes
7. Parte final
7. Parte final Recursos 1. Code: https://github.com/julianespinel/directory 2. Slides: https://speakerdeck.com/julianespinel
7. Parte final
Agenda 1. ¿Qué es Clojure? 2. Conceptos básicos 3. ¿Por
qué aprender Clojure? 4. ¿Qué necesito para programar? 5. Sintaxis del lenguaje 6. API REST en Clojure 7. Parte final 8. Fuentes
8. Fuentes 1. http://clojure.org 2. http://clojure-doc.org 3. http://clojuredocs.org/ 4. http://coding.smashingmagazine.com/2013/04/18/introduction-to-programming-type-systems
5. http://blogs.perl.org/users/ovid/2010/08/what-to-know-before-debating-type-systems.html 6. http://www.lispcast.com/static-vs-dynamic-typing 7. http://gigasquidsoftware.com/blog/2014/02/01/hitchhikers-guide-to-clojure/ 8. http://christophermaier.name/blog/2011/07/07/writing-elegant-clojure-code-using-higher-order- functions 9. http://blakesmith.me/2012/05/25/understanding-clojure-concurrency-part-2.html 10. http://www.cs.yale.edu/quotes.html 11. http://en.wikipedia.org/wiki/Piet_Mondrian 12. http://clojure.org/rationale
8. Fuentes 13. http://tech.puredanger.com/2010/02/09/clojure-4-private-functions/ 14. http://clojure.org/functional_programming 15. http://clojure.org/cheatsheet 16. http://martinfowler.com/articles/richardsonMaturityModel.html
17. http://stackoverflow.com/questions/4420944/why-does-clojure-convert-dashes-in-names-to- underscores-in-the-filesystem