Skip to content

Commit d32a418

Browse files
author
hornik
committed
Comment.
git-svn-id: https://svn.r-project.org/R/trunk@87595 00db46b3-68df-0310-9c12-caf00c1e9a41
1 parent b3426cd commit d32a418

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

src/library/base/R/sets.R

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,28 @@
3333
!identical(class(tryCatch(y[0L], error = identity)), class(y)))
3434
}
3535

36+
## <NOTE>
37+
## We tend to not add internal utility functions to base as these cannot
38+
## really be hidden. Otherwise, we could do something like
39+
## .is_vector_like <- function(x) {
40+
## (length(dim(x)) < 2L) &&
41+
## identical(class(tryCatch(x[0L], error = identity)),
42+
## class(x))
43+
## }
44+
## (or perhaps even add a .is_vector_like() generic with the above as
45+
## default method, and
46+
## .is_same_kind <- function(x, y) {
47+
## isa(x, class(y)) || isa(y, class(x)
48+
## }
49+
## and finally
50+
## .set_ops_need_as_vector <- function(x, y) {
51+
## !.is_vector_like(x) ||
52+
## !.is_vector_like(y) ||
53+
## !.is_same_kind(x, y)
54+
## }
55+
## instead of putting everything into one function.
56+
## </NOTE>
57+
3658
union <-
3759
function(x, y)
3860
{

0 commit comments

Comments
 (0)