I think that basically the cBind man page in the Matrix package was accurate historically, but not quite recently. Here is the class
.A = setClass("A", representation(x="numeric"))
There is nothing in common, so create it by sending the argument "..." (see ?setMethod and ?dotsMethods )
getGeneric("cbind")
Then we implement the method
setMethod("cbind", "A", function(..., deparse.level=1) "cbind,A-method")
And finally use it
> cbind(.A(), .A()) [1] "cbind,A-method"
This is great if the arguments "..." are the same (possibly derived) class, which is often quite good.
> cbind(.A(), integer()) [,1] [1,] ?
I believe bind_activation() has global effects, and not just from sending in your package; it should be avoided (for example, it is no longer used in the Matrix package).
Also, I think it was updated in R-devel
r67699 | legality | 2015-02-01 10:13:23 -0800 (Sun, Feb 01, 2015) | 4 lines
cbind / rbind is now delegated recursively to cbind2 (rbind2) when at least one argument is an S4 object and sending S3 fails; also consider S4 inheritance while sending S3 in the * bind function.
Martin morgan
source share