background preloader

Clojure

Facebook Twitter

Clojars. ClojureDocs - Community powered Clojure Documentation and Examples. Cgrand's enlive at master - GitHub. Clojure quick reference. Clojure relates to these primary data types: Simple values: Booleans Numbers Symbols and keywords Strings and characters Regular expressions Collections: Vector List Set Map Struct Sequence Functions See clojure.org data structures General These operations apply to all values. Operations for simple native data types like boolean and string. Boolean The values nil and false are treated as false in logical tests, any other value is considered true. Number Clojure uses four numeric types: integer Arbitrary precision integer. Clojure uses boxed values (i.e. Literals Arithmetic Comparisons Bit operations Bit operations work with integers (byte short int long BigInteger) only. Casts Tests Symbol and keyword Keywords start with a colon. Symbols start with a single quote ' and can be associated with a value.

Create Use String and character Strings are Java String, characters are Java Character. Casts and tests Regular expressions Test (defn regex? In addition to the primary types there are some special cases: Core API reference (clojure-contrib) By Laurent Petit (and others) Usage: (ns your-namespace (:require clojure.contrib.core)) Overview Functions/macros variants of the ones that can be found in clojure.core (note to other contrib members: feel free to add to this lib) Public Variables and Functions macro Usage: (-? Same as clojure.core/-> but returns nil as soon as the threaded value is nil itself (thus short-circuiting any pending computation). Source Usage: (-? Same as clojure.core/->> but returns nil as soon as the threaded value is nil itself (thus short-circuiting any pending computation).

Source Usage: (.?. Same as clojure.core/.. but returns nil as soon as the threaded value is nil itself (thus short-circuiting any pending computation). Source dissoc-in function Usage: (dissoc-in m [k & ks :as keys]) Dissociates an entry from a nested associative structure returning a new nested structure. keys is a sequence of keys. Source new-by-name Usage: (new-by-name class-name & args) Source seqable? Usage: (seqable? Source. Clojure - Index. Lecture 1A | MIT 6.001 Structure and Interpretation, 1986. Home.