tupelo.interval
Tupelo - Making Clojure even sweeter
->Interval
(->Interval lower upper)
Positional factory function for class tupelo.interval.Interval.
->vals-slice
(->vals-slice itvl)
Inputs: [itvl :- Interval]
For an Interval of integer values, returns to a slice (half-open range) like:
(is= [5 6 7] (->slice-int (interval/new 5 8)))
->vals-thru
(->vals-thru itvl)
Inputs: [itvl :- Interval]
For an Interval of integer values, returns to a `thru` (closed range) like:
(is= [5 6 7 8] (->thru-int (interval/new 5 8)))
closed-contains?
(closed-contains? interval val)
Inputs: [interval :- Interval val :- s/Any]
Returns: s/Bool
Returns true iff a closed interval contains a value such that (lower <= L <= upper).
interval?
(interval? it)
Returns true iff the arg represents an interval
new
(new lower upper)
Inputs: [lower upper]
Creates a new Interval record using the `->Interval` constructor function.
open-contains?
(open-contains? interval val)
Inputs: [interval :- Interval val :- s/Any]
Returns: s/Bool
Returns true iff an open interval contains a value such that (lower < L < upper).
slice-contains?
(slice-contains? interval val)
Inputs: [interval :- Interval val :- s/Any]
Returns: s/Bool
Returns true iff a 'slice' interval contains a value such that (lower <= L < upper).