intslices

This module contains utilities for slices of integers. These utilities include procs that allow treating slices of integers like collections of integers in generic routines.

Procs

proc diff[T, U: SomeInteger](s: HSlice[T, U]): int {...}{.inline.}
Returns the absolute value of s.b - s.a.   Source Edit
proc abs[T, U: SomeInteger](s: HSlice[T, U]): int {...}{.inline.}
Alias for diff.   Source Edit
proc `[]`[I: Ordinal; T, U: SomeInteger](s: HSlice[T, U]; i: I): auto
Returns s.a + i.   Source Edit
proc `[]`[T, U: SomeInteger](s: HSlice[T, U]; i: BackwardsIndex): auto
Returns s.b + 1 - U(i).   Source Edit
proc `[]`[I: Ordinal; T, U: SomeInteger](s: HSlice[T, U]; i: HSlice[I, I]): auto
Returns s[i.a] .. s[i.b].   Source Edit
proc `[]`[I: Ordinal; T, U: SomeInteger](s: HSlice[T, U];
    i: HSlice[I, BackwardsIndex]): auto
Returns s[i.a] .. s[i.b].   Source Edit
proc `[]`[I: Ordinal; T, U: SomeInteger](s: HSlice[T, U];
    i: HSlice[BackwardsIndex, I]): auto
Returns s[i.a] .. s[i.b].   Source Edit
proc `[]`[T, U: SomeInteger](s: HSlice[T, U];
                             i: HSlice[BackwardsIndex, BackwardsIndex]): auto
Returns s[i.a] .. s[i.b].   Source Edit