Unified api for making synchronous and asynchronous requests. The intent is to unify calls to actor libraries along with other kinds of calls.
Unified api for making synchronous and asynchronous requests. The intent is to unify calls to actor libraries along with other kinds of calls.
Read configuration from an EDN file. The EDN file's location is specified using an environment variable (for specifying its location during test, staging or production deployments) as well as a literal path or URL for specifying its location during development. If the environment variable is present, it overrides any absolute path.
In addition, the EDN file being used for configuration may contain template variables as defined by the [[templates]] namespace. Template variables may be resolved through the environment or through keys and values specified in code.
Read configuration from an EDN file. The EDN file's location is specified using an environment variable (for specifying its location during test, staging or production deployments) as well as a literal path or URL for specifying its location during development. If the environment variable is present, it overrides any absolute path. In addition, the EDN file being used for configuration may contain template variables as defined by the [[templates]] namespace. Template variables may be resolved through the environment or through keys and values specified in code.
A 'convert' multimethod that can convert between arbitrary types. Default implementations are supplied for Clojure's built-in types.
A 'convert' multimethod that can convert between arbitrary types. Default implementations are supplied for Clojure's built-in types.
Convert data between various forms; provide useful guard functions. For example:
Convert data between various forms; provide useful guard functions. For example: * any? - Return coll if any element in coll satisfies predicate * replace-nil - If value is not nil, return it, otherwise return replacement * keywordize - Turn string or named value into an idiomatic Clojure :keyword * ->SNAKE_CASE - Turn string or named value into a string in SNAKE_CASE form * Various functions for parsing and processing XML
What is an error? Is nil an error? (Not always, but...) How can we describe functions that might return a result or that might fail? What about exceptions--they break referential transparency, but lots of code throws them anyway. What about functions that might need to retry because some external actor (e.g.: the network) might have intermittent failures?
Error handling is rarely clean, but this namespace provides some handy utilities to centralize some of the concerns and solve them once, reliably. ;-)
What is an error? Is nil an error? (Not always, but...) How can we describe functions that might return a result or that might fail? What about exceptions--they break referential transparency, but lots of code throws them anyway. What about functions that might need to retry because some external actor (e.g.: the network) might have intermittent failures? Error handling is rarely clean, but this namespace provides some handy utilities to centralize some of the concerns and solve them once, reliably. ;-)
Support for making function specs DRYer to write.
Support for making function specs DRYer to write.
Unix-style grep for arbitrary Clojure nested collections. Returns container(s) with at least one element matching a literal, regex, substring, or predicate.
Examples:
(grep 42 {:1 {:a 11} :2 {:b 42}}) => {:b 42} (grep #"[0-9]" [{:a "42"} {:b "Hello, world"}]) => {:a "42"} (grep "world" [{:1 "Hello"} {:1 "Hello, world"}]) => {:1 "Hello, world"} (grep zero? [[1 2 3] [4 5 6] [7 8 9] [0 1 2]]) => [0 1 2]
Unix-style grep for arbitrary Clojure nested collections. Returns container(s) with at least one element matching a literal, regex, substring, or predicate. Examples: (grep 42 {:1 {:a 11} :2 {:b 42}}) => {:b 42} (grep #"[0-9]" [{:a "42"} {:b "Hello, world"}]) => {:a "42"} (grep "world" [{:1 "Hello"} {:1 "Hello, world"}]) => {:1 "Hello, world"} (grep zero? [[1 2 3] [4 5 6] [7 8 9] [0 1 2]]) => [0 1 2]
io address three primary concerns:
io address three primary concerns: * Smoothing necessary Java interop for IO operations, particularly between strings and streams/writers * Extending clojure.java.io to allow specifying an environment variable to use as the input source * (de)Serializing Clojure data structures
Math abstractions. Currently defines a protocol and type for mixed numbers. Provides a sane replacement for clojure.core.rationalize! that always returns a rational number.
MixedNumber can then more rationally render Clojure's Rational type as strings, but can also be used to decompose decimals or rationals > 1 into mixed numbers with easy access to the whole and fractional parts.
Math abstractions. Currently defines a protocol and type for mixed numbers. Provides a sane replacement for clojure.core.rationalize! that always returns a rational number. MixedNumber can then more rationally render Clojure's Rational type as strings, but can also be used to decompose decimals or rationals > 1 into mixed numbers with easy access to the whole and fractional parts.
Convert various time values to milliseconds and back. Decompose millis to days, hours, minutes, and seconds.
Convert various time values to milliseconds and back. Decompose millis to days, hours, minutes, and seconds.
Patterns DRY up code and provide a vocabulary for conversation. This package helps Clojure deal with types from Java, makes it easier to build maps that represent abstract data types, provides functional programming utilities, and adds a Nothing type that behaves as an identity value for maps, sequences, and strings under their various concatination operations. (For Category theorists, it's a monadic zero for these types under concatination and mapcat.) It also provides Nothing constants for cases where Nothing means 'error', 'no result', or simply 'use default settings'.
Patterns DRY up code and provide a vocabulary for conversation. This package helps Clojure deal with types from Java, makes it easier to build maps that represent abstract data types, provides functional programming utilities, and adds a Nothing type that behaves as an identity value for maps, sequences, and strings under their various concatination operations. (For Category theorists, it's a monadic zero for these types under concatination and mapcat.) It also provides Nothing constants for cases where Nothing means 'error', 'no result', or simply 'use default settings'.
A Unix pipe function for Clojure that is implemented by converting regular Clojure functions into transducers over the input.
Input can be any container or a simple type. For a container, the output will be the same type as the input. If the input is a simple type, it will be wrapped in a vector before being processed and the result will be a vector. Supported container types include Map, List, Vector, and Set.
fns may include any of the following:
An arity 1 function is treated as a mapcat function with the following relaxed rules: If it returns a value of a simple type, the value is appended to the output. A nil result is considered an empty result. Otherwise, mapcat semantics are followed. e.g.: if you want the result to be a collection of collections, the sub-collection must first be wrapped in another collection so the sub-collection itself will be concatinated onto the result.
An arity 2 function is treated as a reducing function where the initial two collection elements specify the initial two elements in the reduction. The reducer supports the 'reduced' function in the standard library so that a single input collection can produce multiple reduced outputs.
A vector containing an arity 2 function and a second value treats the function as a reducer and the second value as the initial value in the reduction.
The input is processed through fns, a single element at a time, without creating intermediate collections, in the order in which fns are specified.
A Unix pipe function for Clojure that is implemented by converting regular Clojure functions into transducers over the input. Input can be any container or a simple type. For a container, the output will be the same type as the input. If the input is a simple type, it will be wrapped in a vector before being processed and the result will be a vector. Supported container types include Map, List, Vector, and Set. fns may include any of the following: * An arity 1 function is treated as a mapcat function with the following relaxed rules: If it returns a value of a simple type, the value is appended to the output. A nil result is considered an empty result. Otherwise, mapcat semantics are followed. e.g.: if you want the result to be a collection of collections, the sub-collection must first be wrapped in another collection so the sub-collection itself will be concatinated onto the result. * An arity 2 function is treated as a reducing function where the initial two collection elements specify the initial two elements in the reduction. The reducer supports the 'reduced' function in the standard library so that a single input collection can produce multiple reduced outputs. * A vector containing an arity 2 function and a second value treats the function as a reducer and the second value as the initial value in the reduction. The input is processed through fns, a single element at a time, without creating intermediate collections, in the order in which fns are specified.
Implements variable substitution into strings. Variables are specified in the form ${VAR}. Then, the map {:VAR "value"} substitutes "value" into the string in place of ${VAR}. Also, given a string s can return the names of the variables that must be resolved in s.
Implements variable substitution into strings. Variables are specified in the form ${VAR}. Then, the map {:VAR "value"} substitutes "value" into the string in place of ${VAR}. Also, given a string s can return the names of the variables that must be resolved in s.
Utilities helping to make transducer functions out of regular functions. Transducers can be pipelined like thread-first or thread-list, but using regular function composition.
Unlike thread-first or thread-list, a pipeline of transducers processes a single elemnt through all functions at a time, eliminating the need to create multiple intermediate collections.
Also includes xreduce, a version of reduce that returns a transducer function (this function is seemingly missing from the standard library).
Utilities helping to make transducer functions out of regular functions. Transducers can be pipelined like thread-first or thread-list, but using regular function composition. Unlike thread-first or thread-list, a pipeline of transducers processes a single elemnt through all functions at a time, eliminating the need to create multiple intermediate collections. Also includes xreduce, a version of reduce that returns a transducer function (this function is seemingly missing from the standard library).
Traverse arbitrary Clojure data structures using a visitor (cursor).
Thanks to: http://www.ibm.com/developerworks/library/j-treevisit/
Traverse arbitrary Clojure data structures using a visitor (cursor). Thanks to: http://www.ibm.com/developerworks/library/j-treevisit/
A common place to put code that we always want to run before / after tests.
A common place to put code that we always want to run before / after tests.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close