Skip to content

Commit

Permalink
Comment.
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.r-project.org/R/trunk@87595 00db46b3-68df-0310-9c12-caf00c1e9a41
  • Loading branch information
hornik committed Jan 19, 2025
1 parent b3426cd commit d32a418
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/library/base/R/sets.R
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,28 @@
!identical(class(tryCatch(y[0L], error = identity)), class(y)))
}

## <NOTE>
## We tend to not add internal utility functions to base as these cannot
## really be hidden. Otherwise, we could do something like
## .is_vector_like <- function(x) {
## (length(dim(x)) < 2L) &&
## identical(class(tryCatch(x[0L], error = identity)),
## class(x))
## }
## (or perhaps even add a .is_vector_like() generic with the above as
## default method, and
## .is_same_kind <- function(x, y) {
## isa(x, class(y)) || isa(y, class(x)
## }
## and finally
## .set_ops_need_as_vector <- function(x, y) {
## !.is_vector_like(x) ||
## !.is_vector_like(y) ||
## !.is_same_kind(x, y)
## }
## instead of putting everything into one function.
## </NOTE>

union <-
function(x, y)
{
Expand Down

0 comments on commit d32a418

Please sign in to comment.