Languages Features Creators Calendar CSV Resources Blog About Pricing Add Language
GitHub icon

Clojure

Clojure - Programming language

< >

Clojure is a programming language created in 2007 by Rich Hickey.

#41on PLDB 16Years Old 44.9kUsers
60Books 7Papers 82kRepos

Try now: Riju · TIO · Replit

Clojure ( , like "closure") is a dialect of the Lisp programming language. Clojure is a general-purpose programming language with an emphasis on functional programming. It runs on the Java virtual machine and the Common Language Runtime. Read more on Wikipedia...


Example from Riju:
(println "Hello, world!")
Example from hello-world:
(println "Hello World")
; Hello world in Clojure (defn hello [] (println "Hello world!")) (hello)
Example from Linguist:
(defn rand "Returns a random floating point number between 0 (inclusive) and n (default 1) (exclusive)." ([] (scm* [n] (random-real))) ([n] (* (rand) n)))
Example from Wikipedia:
;; A typical entry point of a Clojure program: ;; `-main` function (defn -main ; name [& args] ; (variable) parameters (println "Hello, World!")) ; body

Language features

Feature Supported Token Example
Integers
; -?\d+
Floats
; -?\d+\.\d+
Hexadecimals
; 0x-?[abcdef\d]+
MultiLine Comments (comment )
(comment A comment
)
Print() Debugging println
Homoiconicity
Line Comments ;
; A comment
Operator Overloading
Macros
; https://www.braveclojure.com/writing-macros/
; https://clojure.org/reference/macros
(defmacro and
 "Evaluates exprs one at a time, from left to right. If a form
 returns logical false (nil or false), and returns that value and
 doesn't evaluate any of the other expressions, otherwise it returns
 the value of the last expr. (and) returns true."
 {:added "1.0"}
 ([] true)
 ([x] x)
 ([x & next]
  `(let [and# ~x]
     (if and# (and ~@next) and#))))
File Imports
(load "fun")
(load "files/fun")
(load-file "./files/fun.clj")
(defproject project-a
:dependencies [[org.clojure/clojure "1.5.1"]
              [project-b "0.1.0"]])
(require '[clojure.string :as string])
(use '[clojure.string :only [split]])
(import 'java.util.Date)
(java.util.Date.)
(require 'clojure.contrib.def 'clojure.contrib.except 'clojure.contrib.sql)
(require '(clojure.contrib def except sql))
Comments
Partial Application
(defn fun-full [x y] (+ x y))
(fun-full 2 3)
(def fun-half (partial fun-full 2))
(fun-half 3)
Strings "
"hello world"
Lispy
Case Insensitive Identifiers X
Semantic Indentation X

Books about Clojure on goodreads

title author year reviews ratings rating
Programming Clojure Stuart Halloway 2009 45 559 3.82
Clojure Programming Chas Emerick 2011 30 423 4.18
Clojure Reactive Programming Leonardo Borges 2015 1 21 3.81
Clojure Cookbook: Recipes for Functional Programming Luke VanderHart 2014 5 55 3.75
Clojure High Performance Programming Shantanu Kumar 2013 4 19 2.84

Books about Clojure from ISBNdb

title authors year publisher
Clojure Reactive Programming Borges, Leonardo 2015 Packt Publishing
Clojure Programming: Practical Lisp for the Java World Emerick, Chas and Carper, Brian and Grand, Christophe 2012 O'Reilly Media
The Joy of Clojure: Thinking the Clojure Way Michael Fogus and Chris Houser 2011 Manning Publications
Clojure Applied: From Practice to Practitioner Vandgrift, Ben and Miller, Alex 2015 Pragmatic Bookshelf
Mastering Clojure Macros: Write Cleaner, Faster, Smarter Code Jones, Colin 2014 Pragmatic Bookshelf
Programming Clojure Halloway, Stuart and Bedra, Aaron 2012 Pragmatic Bookshelf
Mastering Clojure Data Analysis Rochester, Eric 2014 Packt Publishing
Mastering Clojure Wali, Akhil 2016 Packt Publishing
Clojure for Java Developers Diaz, Eduardo 2016 Packt Publishing
The Joy of Clojure Michael Fogus and Chris Houser 2014 Manning Publications
Web Development with Clojure Sotnikov, Dmitri and Brown, Scot 2021 Pragmatic Bookshelf
The Clojure Workshop: Use functional programming to build data-centric applications with Clojure and ClojureScript Fahey, Joseph and Haratyk, Thomas and McCaughie, Scott and Sharvit, Yehonathan and Szydlo, Konrad 2020 Packt Publishing
Professional Clojure Anderson, Jeremy and Gaare, Michael and Holguín, Justin and Bailey, Nick and Pratley, Timothy 2016 Wrox
Professional Clojure Anderson, Jeremy and Gaare, Michael and Holguín, Justin and Bailey, Nick and Pratley, Timothy 2016 Wrox
Programming Clojure (The Pragmatic Programmers) Miller, Alex and Halloway, Stuart and Bedra, Aaron 2018-03-20T00:00:01Z Pragmatic Bookshelf
Clojure for Data Science Garner, Henry 2015 Packt Publishing
Clojure Reactive Programming - How to Develop Concurrent and Asynchronous Applications with Clojure Borges, Leonardo 2015 Packt Publishing
Clojure Cookbook: Recipes for Functional Programming VanderHart, Luke and Neufeld, Ryan 2014 O'Reilly Media
Clojure Recipes (Developer's Library) Gamble, Julian 2015 Addison-Wesley Professional
Clojure for Machine Learning Wali, Akhil 2014 Packt Publishing
Programming Clojure (Pragmatic Programmers) Halloway, Stuart 2009-06-07T00:00:01Z Pragmatic Bookshelf
Practical Clojure (Expert's Voice in Open Source) VanderHart, Luke and Sierra, Stuart 2010 Apress
Clojure Data Structures and Algorithms Cookbook Naccache, Rafik 2015 Packt Publishing
Clojure Programming Cookbook Hashimoto, Makoto and Modrzyk, Nicolas 2016 Packt Publishing
Clojure High Performance Programming Kumar, Shantanu 2013 Packt Publishing
Clojure for Domain-specific Languages D. Kelker, Ryan 2013 Packt Publishing
Clojure for Finance Washington, Timothy 2016 Packt Publishing
Clojure Stefan Kamphausen and Tim Oliver Kaiser 2010-09-01 dpunkt
Clojure Cookbook Luke VanderHart; Ryan Neufeld 20140305 O'Reilly Media, Inc.
Getting Clojure Russ Olsen 20180509 O'Reilly Media, Inc.
Living Clojure Carin Meier 20150414 O'Reilly Media, Inc.
Mastering Clojure Akhil Wali 28-03-2016 Packt Publishing
Clojure Polymorphism Paul Stadig 20191115 Packt Publishing
Living Clojure Carin Meier 20150414 O'Reilly Media, Inc.
Clojure in Action Amit Rathore 20151216 Simon & Schuster
Microservices with Clojure Anuj Kumar 25-01-2018 Packt Publishing
Clojure Programming Chas Emerick; Brian Carper; Christophe Grand 20120330 O'Reilly Media, Inc.
Clojure Cookbook Luke VanderHart; Ryan Neufeld 20140305 O'Reilly Media, Inc.
Clojure Programming Chas Emerick; Brian Carper; Christophe Grand 20120330 O'Reilly Media, Inc.
Clojure Programming Cookbook Makoto Hashimoto and Nicolas Modrzyk 2016 Packt Publishing Ltd
The Joy of Clojure Chris Houser; Michael Fogus 20140528 Simon & Schuster
Clojure High Performance Programming Shantanu Kumar 2013-11-20 Packt Publishing
Clojure for Finance Timothy Washington 2016-01-11 Packt Publishing
Clojure Programming Cookbook Makoto Hashimoto 28-10-2016 Packt Publishing
Clojure for Data Science Henry Garner 20150903 Packt Publishing
Clojure Web Development Essentials Ryan Baldwin 20150224 Packt Publishing
Clojure for Machine Learning Akhil Wali 2014-04-24 Packt Publishing
Web Development with Clojure Dmitri Sotnikov 20160714 O'Reilly Media, Inc.
Clojure for Java Developers Eduardo Diaz 23-02-2016 Packt Publishing
Clojure for Domain-specific Languages Ryan D. Kelker 2013-12-18 Packt Publishing
Clojure for the Brave and True Daniel Higginbotham 20151015 Random House Publishing Services
Clojure High Performance Programming - Second Edition Kumar and Shantanu 2015 Packt Publishing 2015-09-29
Clojure High Performance Programming - Second Edition Shantanu Kumar 20150929 Packt Publishing
Clojure 134 Success Secrets - 134 Most Asked Questions On Clojure - What You Need To Know Cynthia Harmon 20141030 Emereo
Hands-On Reactive Programming with Clojure Konrad Szydlo; Leonardo Borges 25-01-2019 Packt Publishing

Publications about Clojure from Semantic Scholar

title authors year citations influentialCitations
The Clojure programming language R. Hickey 2008 187 20
Getting Started with Google App Engine and Clojure Aaron Bedra 2010 36 3
A history of Clojure R. Hickey 2020 12 3
Practical Clojure Luke VanderHart and S. Sierra 2010 5 0
cljRobust - Clojure Programming API for Lego Mindstorms NXT K. Kułakowski 2010 4 0
An open source implementation of an intuitionistic fuzzy inference system in Clojure Amaury Hernández-Águila and Mario García Valdez and O. Castillo and J. J. M. Guervós 2017 2 0
Towards Static Verification of Clojure Contract-Based Programs Gheorghe Pinzaru and V. Rivera 2019 2 0
bash.html · clojure.html · isbn.html

View source

- Build the next great programming language · Search · v2023 · Day 205 · Docs · Acknowledgements · Traffic · Traffic Today · Mirrors · GitHub · feedback@pldb.com