API for generic.arithmetic - clojure-contrib v1.1 (stable)

by Konrad Hinsen

clojure-contrib is now deprecated

clojure-contrib is no longer being developed or maintained.

Rather than a single, monolithic, contributions library, Clojure now has a set of separate libraries for each unit of functionality. The libraries are in the Clojure GitHub organization at https://github.com/clojure. API documentation of the libraries can be found at https://clojure.github.io.

If you're looking for a specific function or namespace from the old clojure-contrib, see "Where Did Clojure.Contrib Go".


Full namespace name: clojure.contrib.generic.arithmetic

Overview

Generic arithmetic interface
This library defines generic versions of + - * / as multimethods
that can be defined for any type. The minimal required
implementations for a type are binary + and * plus unary - and /.
Everything else is derived from these automatically. Explicit
binary definitions for - and / can be provided for
efficiency reasons.

Public Variables and Functions



*

multimethod
This library, clojure-contrib, is deprecated. See here for more information.
Usage: (* x)
       (* x y)
       (* x y & more)
Return the product of all arguments. The minimal implementation for type
::my-type is the binary form with dispatch value [::my-type ::my-type].
Source


+

multimethod
This library, clojure-contrib, is deprecated. See here for more information.
Usage: (+ x)
       (+ x y)
       (+ x y & more)
Return the sum of all arguments. The minimal implementation for type
::my-type is the binary form with dispatch value [::my-type ::my-type].
Source


-

multimethod
This library, clojure-contrib, is deprecated. See here for more information.
Usage: (- x)
       (- x y)
       (- x y & more)
Return the difference of the first argument and the sum of all other
arguments. The minimal implementation for type ::my-type is the binary
form with dispatch value [::my-type ::my-type].
Source


/

multimethod
This library, clojure-contrib, is deprecated. See here for more information.
Usage: (/ x)
       (/ x y)
       (/ x y & more)
Return the quotient of the first argument and the product of all other
arguments. The minimal implementation for type ::my-type is the binary
form with dispatch value [::my-type ::my-type].
Source


defmethod*

macro
This library, clojure-contrib, is deprecated. See here for more information.
Usage: (defmethod* ns name & args)
Define a method implementation for the multimethod name in namespace ns.
Required for implementing the division function from another namespace.
Source


qsym

macro
This library, clojure-contrib, is deprecated. See here for more information.
Usage: (qsym ns sym)
Create the qualified symbol corresponding to sym in namespace ns.
Required to access the division function from another namespace,
e.g. as (qsym clojure.contrib.generic.arithmetic /).
Source
Logo & site design by Tom Hickey.
Clojure auto-documentation system by Tom Faulhaber.