Re: cbind is not generic as claimed, omits labels where S has them (PR#239)

About this list Date view Thread view Subject view Author view Other groups

Subject: Re: cbind is not generic as claimed, omits labels where S has them (PR#239)
From: Ross Ihaka (ihaka@stat.auckland.ac.nz)
Date: Sat 07 Aug 1999 - 07:12:42 EST


Message-ID: <19990807091242.A15242@stat1.stat.auckland.ac.nz>

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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b25 : Tue 04 Jan 2000 - 14:16:07 EST