Re: [Rd] relist, an inverse operator to unlist

From: Martin Maechler <maechler_at_stat.math.ethz.ch>
Date: Tue, 22 May 2007 19:41:34 +0200

>>>>> "AndrewC" == Andrew Clausen <clausen_at_econ.upenn.edu> >>>>> on Tue, 22 May 2007 07:51:54 -0400 writes:

    AndrewC> Hi Seth,
    AndrewC> On Mon, May 21, 2007 at 05:15:10PM -0700, Seth Falcon wrote:
>> I will also add that the notion of a default argument on a generic
>> function seems a bit odd to me. If an argument is available for
>> dispatch, I just don't see what sense it makes to have a default. In
>> those cases, the default should be handled by the method that has a
>> signature with said argument matching the "missing" class.
>>
>> What often does make sense is to define a generic function where some
>> argument are not available for dispatch. For example:
>>
>> setGeneric("foo", signature="flesh",
>> function(flesh, skeleton=attr(flesh, "skeleton")
>> standardGeneric("foo")))

    AndrewC> That's an excellent suggestion. Thanks! However, I had to set the signature     AndrewC> to c("numeric", "missing") rather than just "numeric".

    AndrewC> I have uploaded a new version here:

    AndrewC> http://www.econ.upenn.edu/~clausen/computing/relist.R

This looks "good from far".

I won't have time to do anything more about it for the next few days.
Please remind me (in private) about it if you don't hear back within one week.

Martin

    AndrewC> Cheers,
    AndrewC> Andrew



R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Tue 22 May 2007 - 19:36:57 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 22 May 2007 - 20:35:46 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.