Generic, basic error handling. No dependencies aside from apache commons math for NAN exception.
(check-idx idx n-elems)
Check that an index is less than n-elems. Throw an index-out-of-bounds exception if that isn't the case.
Check if arg is double NaN and throw an exception if so.
(check-offset-length offset length elem-ecount)
Check that a combined offset and length fit within elem-ecount. Throw an exception with a nice message in the case where bounds were exceeded.
(throw-index-out-of-boundsf msg & args)
Throw an index out of bounds exception with a nice message.
Throw a NAN exception.
(throw-unimplemented & _args)
(throwf message & args)
Throw an exception and format a message
(when-not-error expr error-msg)
Throw an error in the case where expr isn't true.
(when-not-errorf expr error-msg & args)
Throw an exception with formatting in the case where expr isn't true.