Skip to content

Generic predicates should operate on proxy but not restore #251

Closed
@lionel-

Description

@lionel-

They probably should always return an untyped bool.

new_cached_sum <- function(x = double(), sum = 0L) {
  new_vctr(x, sum = sum, class = "vctrs_cached_sum")
}
vec_restore.vctrs_cached_sum <- function(x, to, ..., i = NULL) {
  new_cached_sum(x, sum(x))
}
x <- new_cached_sum(runif(10))

is.finite(x)
#> <vctrs_cached_sum[10]>
#>  [1] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions