API for generic.comparison
- ()
by Konrad Hinsen
Usage:
(ns your-namespace
(:require clojure.contrib.generic.comparison))
Overview
Generic comparison interface
This library defines generic versions of = < > <= >= zero?
as multimethods that can be defined for any type. Of the
greater/less-than relations, types must minimally implement >.
Public Variables and Functions
<
multimethod
Usage: (< x)
(< x y)
(< x y & more)
Return true if each argument is smaller than the following ones.
The minimal implementation for type ::my-type is the binary form
with dispatch value [::my-type ::my-type]. A default implementation
is provided in terms of >.
Source
<=
multimethod
Usage: (<= x)
(<= x y)
(<= x y & more)
Return true if each arguments is smaller than or equal to the following
ones. The minimal implementation for type ::my-type is the binary form
with dispatch value [::my-type ::my-type]. A default implementation
is provided in terms of >.
Source
=
multimethod
Usage: (= x)
(= x y)
(= x y & more)
Return true if all arguments are equal. The minimal implementation for type
::my-type is the binary form with dispatch value [::my-type ::my-type].
Source
>
multimethod
Usage: (> x)
(> x y)
(> x y & more)
Return true if each argument is larger than the following ones.
The minimal implementation for type ::my-type is the binary form
with dispatch value [::my-type ::my-type].
Source
>=
multimethod
Usage: (>= x)
(>= x y)
(>= x y & more)
Return true if each argument is larger than or equal to the following
ones. The minimal implementation for type ::my-type is the binary form
with dispatch value [::my-type ::my-type]. A default implementation
is provided in terms of <.
Source
zero?
multimethod
Usage: (zero? x)
Return true of x is zero.
Source