R/50-ordered_sequence-boundaries.R

Defines functions c.ordered_sequence .oms_stop_interval_index

#SO

# Runtime: O(1).
.oms_stop_interval_index <- function(x, fn_name) {
  if(inherits(x, "interval_index")) {
    stop(sprintf("`%s()` is not supported for interval_index. Use interval query helpers (`peek_*`, `pop_*`, and `peek_point()`).", fn_name))
  }
  invisible(TRUE)
}

#' Ordered sequences cannot be concatenated with `c()`
#'
#' Rebuild with `ordered_sequence()` / `as_ordered_sequence()` if you need to
#' combine ordered keyed values.
#'
#' @method c ordered_sequence
#' @param ... Ordered objects.
#' @param recursive Unused.
#' @return Never returns; always errors.
#' @export
#' @noRd
# Runtime: O(1).
c.ordered_sequence <- function(..., recursive = FALSE) {
  xs <- list(...)
  target <- if(length(xs) == 0L) "ordered_sequence" else .ft_ordered_owner_class(xs[[1L]])
  stop(sprintf("`c()` is not supported for %s. Cast first with `as_flexseq()`.", target))
}

Try the Immutables package in your browser

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

Immutables documentation built on April 29, 2026, 1:06 a.m.