cbind is not generic as claimed, omits labels where S has them (PR#239)
Ross Ihaka
ihaka@stat.auckland.ac.nz
Sat, 7 Aug 1999 09:12:42 +1200
Ok, I have made some changes to cbind/rbind which will support dispatch
to other methods. As part of this I have changed things so that the
values passed on are packaged up as (evaluated) promises so that any
closure they invoke will be able to use substitute to get text values
to use as labels. What I need is a clear idea of the rules for doing
the dispatch. The picture I have at present is:
dispatch.class <- "default"
for (arg in arg.list) {
if (arg is an object) {
arg.class <- class(arg)[1]
if (there is a method for arg.class) {
if (dispatch.class == "default")
class <- arg.class
else if (args.class != dispatch.class)
drop through to dispatch
}
}
}
dispatch:
if (dispatch.class != "default")
dispatch to appropriate closure
else
carry out default actions
This also looks like it sufficiently generic that it could be packaged
as a useful function along the lines of "DespatchOrEval" -- perhaps
MultiDespatchOrEval.
Does this sound right?
Ross
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._