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
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Julian Espinel
March 01, 2014
Programming
77
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
Transcript
57 slides
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
More Decks by Julian Espinel
See All by Julian Espinel
Deploy and monitor an application with Docker
julianespinel
0
87
Building a microservice
julianespinel
0
80
Microservices
julianespinel
1
80
Autheo
julianespinel
1
180
Other Decks in Programming
See All in Programming
The Cost of the DOM
ypresto
2
380
はじめてのPLATEAU
nokonoko1203
1
670
Skills Are the New npm [AAIF Bengaluru, Nov 2026]
shivamsaraswat
0
130
Proxmox x Talos Linux x Terraform で実現するなんかいい感じの Kubernetes クラスタ / A Sleek Kubernetes Cluster Powered by Proxmox, Talos Linux, and Terraform
nnaka2992
0
310
[DroidKnights 2026] Workflow AX: From Auto-Documented Policies to E2E Testing
raeminkang
0
610
느린 네트워크와 저사양 디바이스 사용자를 위한 웹뷰 로딩 시간 개선기
kmkim
1
270
そのデザイントークン、Flutterでも同じ見た目になりますか?
nakamizu
0
490
Going Full Circle with Virtual Graphs and Relational Databases
michaelsimons
1
110
Debian JP Projectのサーバー構成
uwabami
1
180
ローカルLLMの基本と近況 2611 / Local LLM basics and recent situation 2611
kishida
3
660
あなたはMCPの機能を、まだ知らない。
4geru
1
740
[Kotlin Fest 2026] eBPF Tracing for Kotlin
takehaya
1
410
Featured
See All Featured
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
2.2k
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
340
Building Adaptive Systems
keathley
44
3.3k
Faster Mobile Websites
deanohume
310
32k
Designing for Timeless Needs
cassininazir
1
570
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.7k
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
3
3.9k
Discover your Explorer Soul
emna__ayadi
2
1.3k
My Coaching Mixtape
mlcsv
0
400
BBQ
matthewcrist
90
10k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
1.1k
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
2
540