File: key_missing.R

package info (click to toggle)
r-cran-fastmap 1.2.0-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 352 kB
  • sloc: cpp: 1,992; ansic: 33; sh: 13; makefile: 2
file content (25 lines) | stat: -rw-r--r-- 483 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#' A missing key object
#'
#' A \code{key_missing} object represents a missing key.
#'
#' @param x An object to test.
#'
#' @export
key_missing <- function() {
  # Note: this is more verbose, but much faster than
  # structure(list(), class = "key_missing")
  x <- list()
  class(x) <- "key_missing"
  x
}

#' @rdname key_missing
#' @export
is.key_missing <- function(x) {
  inherits(x, "key_missing")
}

#' @export
print.key_missing <- function(x, ...) {
  cat("<Key Missing>\n")
}