Re: [Rd] standardization of slot access

From: Roger Bivand <Roger.Bivand_at_nhh.no>
Date: Wed 27 Sep 2006 - 06:26:10 GMT


On Tue, 26 Sep 2006, Sebastian P. Luque wrote:

> Thank you all for your comments, which confirm the feeling I had that
> 'slot' is only needed in the rare occasions Roger mentioned. Although
> 'slot' is an accessor function, it seems it's not quite analogous to
> functions or methods for accessing components of objects.
>

I find that slot() is useful in explaining to users what is going on. I also find that used inside s/lapply that say function(x) slot(x, "y") is a natural way to access contents of lists of objects. So I wouldn't conclude that it is only rarely used, and would recommend its use in explaining to students/users what is going on in new-style objects.

Roger

>
> Cheers,
>
>

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand@nhh.no

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Wed Sep 27 16:27:36 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Wed 27 Sep 2006 - 09:30:09 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.