From Martin Maechler <maechler@stat.math.ethz.ch>  Thu Mar 25 17:56:16 1999
From: Martin Maechler <maechler@stat.math.ethz.ch> (Martin Maechler)
Date: Thu, 25 Mar 1999 18:56:16 +0100
Subject: [R] Change of parsing parameters to functions between 0.63.1  and 0.63.3 ?
In-Reply-To: <x2soat4r21.fsf@blueberry.kubism.ku.dk> (message from Peter
 Dalgaard BSA on 25 Mar 1999 14:49:58 +0100)
References: <Pine.GSO.4.05.9903241827480.6272-100000@auk.stats> <x2lnglzrn0.fsf@blueberry.kubism.ku.dk> <199903251312.OAA06684@sophie.ethz.ch> <x2soat4r21.fsf@blueberry.kubism.ku.dk>
Message-ID: <199903251756.SAA07768@sophie.ethz.ch>

>>>>> "PD" == Peter Dalgaard BSA <p.dalgaard@biostat.ku.dk> writes:

    PD> Martin Maechler <maechler@stat.math.ethz.ch> writes:
    PD> dimensional slices to get the names passed down [using
    PD> array(newX[,i], d.call, dn.call) with dn.call containing the names]
    >> 
    PD> ..should I consider that a bad move?
    >> ^^^^^^
    >> (your patch)
    >> Yes, I actually think
    >> your patch should be reverted ___ especially since it even breaks
    >> example(apply)

    PD> Oh sh...! I thought that "length(d.call) < 2" bit looked fishy. Forgot
    PD> (or whatever) that the 0 case was in fact possible.

    PD> But that is easily fixable, just don't do in the extreme case.
    PD> This seems to work better:

    PD> if ((i.vec <- length(d.call) < 2)) 
    PD> for (i in 1:d2) {
    PD> xi <- newX[, i]
    PD> if (length(dn.call) == 1) 
    PD> names(xi) <- dn.call[[1]]
    PD> ans[[i]] <- FUN(xi, ...)
    PD> }
    PD> else for (i in 1:d2) ans[[i]] <- FUN(array(newX[, i], d.call, dn.call), ...)

    PD> *NOW* should we keep it?

According to our general strategy  

   ``Be S compatible unless there's a good reason for NOT being..''

I think we should keep it.
I did some very limited CPU usage testing and the new code (compared to 0.63.3)
seems to increase CPU usage by less than 1%  (no std.err available on this :-)

---> committed -- including a new help-example exhibiting the new behavior

Martin Maechler <maechler@stat.math.ethz.ch>	http://stat.ethz.ch/~maechler/
Seminar fuer Statistik, ETH-Zentrum SOL G1;	Sonneggstr.33
ETH (Federal Inst. Technology)	8092 Zurich	SWITZERLAND
phone: x-41-1-632-3408		fax: ...-1086			<><
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


[R] Change of parsing parameters to functions between 0.63.1 and 0.63.3 ?
Martin Maechler