Clojure Programming

From Wikibooks, open books for an open world
Jump to: navigation, search

Clojure is a dynamic programming language for the JVM.

Contents

[edit] Introduction

People come to Clojure from a variety of backgrounds. The purpose of this book is to help everyone get the most out of the Clojure language. It is not meant as a replacement for the documentation, found at the Clojure site. Please do not copy material from there to here!

Feel free to post your own code, written in the Clojure language, here. However, please do not post excerpts, patches or other modifications or derivations of the Clojure source itself, as the license of this Wiki is incompatible with the Clojure license. Instead, post such things to the Clojure discussion group.

[edit] FAQ

[edit] Getting started

The Getting started section covers obtaining and installing Clojure as well as basic setup of editors such as Emacs or Vim.

[edit] Concepts

The Concepts section covers Clojure language basics, such as supported datatypes, "mutability" or state in Clojure, functional programming and the concurrency features. Also see the book Learning Clojure.

[edit] Tutorials and Tips

By Example is an introductory look at Clojure that is heavy on examples to introduce the look and meaning of various constructs.

The Tutorials and Tips section covers differences with other languages and miscellaneous tutorials.

Learning Clojure gives an examination of Clojure's features.

The labrepl is an interactive environment for learning Clojure.

Try Clojure lets you try out Clojure in a browser, with no local installation required.

4clojure presents a series of small programming problems to help you learn Clojure (web based, no install required)

clojure-koans is great way for beginners to learn the basic syntax and built in functions of Clojure

[edit] Examples

This section is a cookbook with various Clojure examples, including

[edit] API Examples

This section is for examples using the Clojure API

[edit] Cookbook

[edit] Links to further Examples

[edit] Graphics and Image Processing

  • Context Free Art clone [1]
  • ImageJ and Clojure (via Fiji) [2]
  • Port of JOGL OpenGL Gears demo [3]
  • OpenGL Tetrahedron ported from Wikipedia JOGL example [4]
  • Simple SparkLine Generator in Clojure [5]

[edit] Web Programming


[edit] A library stack for web programming would consist of

  • Ring: Ring provides a standard interface to talk to web servers, and a set of libraries for handling things like sessions and file uploads.
  • Framework: These provide a nice high-level interface that is suited for defining the routes and controller logic of a web application.
  • Compojure
  • Noir
  • Moustache
  • Conjure
  • funkyweb
  • HTML generator: dynamically generate HTML pages.
  • Hiccup
  • Fleet
  • Enlive
  • Other libraries, that don't fit into any of the above categories
  • Sandbar
  • Compojure-Rest.

[edit] Miscellaneous

[edit] Reference

Personal tools
Namespaces
Variants
Actions
Navigation
Community
Toolbox
In other languages
Sister projects
Print/export