## THIS IS MEANT TO SERVE AS AN ALTERNATIVE TO stopifnot()  
## BUT THIS FALLS SHORT IN THAT THE VARIABLES IN THE CALLING 
## FUNCTION ARE NOT DIRECTLY ACCESSIBLE...  NEED TO USE get("x", envir=parent.frame())



browserifnot <- function (...)  {
## Note, this does not QUITE work, because all of the variables are in the parent.frame

    ll <- list(...)
    n <- length(ll)
    if (n == 0L) 
        return(invisible())

    mc <- match.call()
    for (i in 1L:n)
      if (!(is.logical(r <- ll[[i]]) && !any(is.na(r)) && all(r))) {
          ch <- deparse(mc[[i + 1]], width.cutoff = 90L)
          if (length(ch) > 1L) 
              ch <- paste(ch[1L], "....")
          ## INSTEAD OF stop() use browser()
          msg <- sprintf(ngettext(length(r), "%s is not TRUE", "%s are not all TRUE"), ch)
          message(paste(msg, ".\nEntering browser() ..."))
          # browser(text=msg, skipCalls=0L)
          browser(text=msg)
      }
    invisible()
}
