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
Introduction to Clojure
Search
Julian Espinel
March 01, 2014
Programming
71
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
81
Building a microservice
julianespinel
0
74
Microservices
julianespinel
1
73
Autheo
julianespinel
1
180
Other Decks in Programming
See All in Programming
Foundation Models frameworkで画像分析
ryodeveloper
1
570
ドリフトを絶対に許さない(?)CDK運用 / CDK Ops with Zero Tolerance for Drifts (?)
akihisaikeda
1
170
Welcome to the "Parametricity" 🏙️ − Generic だけど Specific な世界 −
guvalif
PRO
1
200
AI時代のPHPer生存戦略 ~「言語、もうなんでもよくない?」に本気で向き合う~
vivion
0
240
関東Kaggler会_NVIDIA_Nemotron_コンペ_振り返り
rick_ds
0
370
霧の中の代数的エフェクト
funnyycat
1
470
<title><a id="</title>君はこのHTMLをパースできるか"></a></title> #雑LT_study
pizzacat83
0
140
進化を続けるGo toolsの現在地 / The Current State of Ever-Evolving Go Tools
hond0413
0
130
生成AIで帳票OCRが「簡単に」作れる時代になった?
kon_shou
0
510
Laravelで学ぶ Webアプリケーションチューニング入門/web_application_tuning_101
hanhan1978
4
1.7k
20260722_microCMSで考える、AI時代のコンテンツ運用設計
yosh1
0
360
全PRの83%がAIレビューだけでマージできるようになった開発組織はその後どうなったか
athug
1
1.5k
Featured
See All Featured
Code Review Best Practice
trishagee
74
20k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
2k
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
440
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
72
41k
HDC tutorial
michielstock
2
780
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
2.1k
Product Roadmaps are Hard
iamctodd
55
12k
Technical Leadership for Architectural Decision Making
baasie
3
470
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
1.1k
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
330
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
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