Re: [Rd] S4 accessors

2006-09-28 Thread John Chambers
Maybe this was not as obvious or well-known as I assumed would be the case on this list. In an OOP system (I dislike the term but let's use it), the programming mechanism is to invoke a method on an object. Say method flag on object x: x$flag() (using "$" in R style instead of the usual "

Re: [Rd] S4 accessors

2006-09-27 Thread Ross Boylan
I'm trying to understand what the underlying issues are here--with the immediate goal of how that affects my design and documentation decisions. On Wed, Sep 27, 2006 at 02:08:34PM -0400, John Chambers wrote: > Seth Falcon wrote: > > John Chambers <[EMAIL PROTECTED]> writes: > > > > > >> There i

Re: [Rd] S4 accessors

2006-09-27 Thread Henrik Bengtsson
On 9/27/06, John Chambers <[EMAIL PROTECTED]> wrote: > There is a point that needs to be remembered in discussions of accessor > functions (and more generally). > > We're working with a class/method mechanism in a _functional_ language. > Simple analogies made from class-based languages such as Jav

Re: [Rd] S4 accessors

2006-09-27 Thread John Chambers
Seth Falcon wrote: > John Chambers <[EMAIL PROTECTED]> writes: > > >> There is a point that needs to be remembered in discussions of >> accessor functions (and more generally). >> >> We're working with a class/method mechanism in a _functional_ >> language. Simple analogies made from class-base

Re: [Rd] S4 accessors

2006-09-27 Thread Seth Falcon
John Chambers <[EMAIL PROTECTED]> writes: > There is a point that needs to be remembered in discussions of > accessor functions (and more generally). > > We're working with a class/method mechanism in a _functional_ > language. Simple analogies made from class-based languages such as > Java are n

Re: [Rd] S4 accessors

2006-09-27 Thread John Chambers
There is a point that needs to be remembered in discussions of accessor functions (and more generally). We're working with a class/method mechanism in a _functional_ language. Simple analogies made from class-based languages such as Java are not always good guides. In the example below, "a fu

Re: [Rd] S4 accessors

2006-09-26 Thread Ross Boylan
On Tue, 2006-09-26 at 10:43 -0700, Seth Falcon wrote: > Ross Boylan <[EMAIL PROTECTED]> writes: > >> If anyone else is going to extend your classes, then you are doing > >> them a disservice by not making these proper methods. It means that > >> you can control what happens when they are called o

Re: [Rd] S4 accessors

2006-09-26 Thread Seth Falcon
Ross Boylan <[EMAIL PROTECTED]> writes: > Did you want this offlist? I'm happy keeping it on the list. No, I accidentally responded privately and I believe I already resent my reply to the list. Sorry about that. I've cc'd the list for this response. >> If anyone else is going to extend your c

Re: [Rd] S4 accessors

2006-09-25 Thread Seth Falcon
Ross Boylan <[EMAIL PROTECTED]> writes: > The code has a couple of decisions for which I could imagine > alternatives. First, even simple get/set operations on class elements > are wrapped in functions. I suppose I could just use [EMAIL PROTECTED] to > do some of these operations, though that is

Re: [Rd] S4 accessors (corrected)

2006-09-25 Thread Ross Boylan
On Tue, 2006-09-26 at 00:20 +, Ross Boylan wrote: > I have a small S4 class for which I've written a page grouping many of > the accessors and replacement functions together. I would be interested > in people comments on the approach I've taken. > > The code has a couple of decisions for whic

[Rd] S4 accessors

2006-09-25 Thread Ross Boylan
I have a small S4 class for which I've written a page grouping many of the accessors and replacement functions together. I would be interested in people comments on the approach I've taken. The code has a couple of decisions for which I could imagine alternatives. First, even simple get/set oper