R/assert.R

`%because%` <- function(cond, reason) {
  if (!cond) stop(reason, call. = FALSE)
}

`%unless%` <- function(expr, exception) {
  tryCatch(expr, error = function(.) stop(exception, call. = FALSE))
}

Try the dub package in your browser

Any scripts or data that you put into this service are public.

dub documentation built on May 2, 2019, 7:55 a.m.