From tplate at acm.org  Wed Sep 27 01:04:53 2006
From: tplate at acm.org (Tony Plate)
Date: Tue, 26 Sep 2006 17:04:53 -0600
Subject: [Rd] standardization of slot access
In-Reply-To: <87y7s6bbhq.fsf@patagonia.sebmags.homelinux.org>
References: <87y7s6bbhq.fsf@patagonia.sebmags.homelinux.org>
Message-ID: <4519B215.7070205@acm.org>

I believe that the "accessor" functions you've read about are not the 
slot() function, rather they are functions specifically designed for 
extracting certain data from an object.  An example is the 'coef()' 
extractor function, which extracts coefficients from many model objects. 
  The name of the accessor function need not bear any resemblance to the 
actual name of the slot in which the data is stored, and indeed, there 
does not even need to be a one-to-one relationship between accessor 
functions and slots.

AFAIK, slot() and '@' can be regarded as syntactic variants (please 
correct me if I'm wrong).

-- Tony Plate

Sebastian P. Luque wrote:
> Hi,
> 
> I'm usually confused about when to use 'slot' or '@'.  I've frequently
> read that it's always preferable to use accessor functions, so I would
> think the '@' operator should be avoided.  However, ?slot contains the
> following advise:
> 
> 
> "Generally, the only reason to use the functional form rather than the
> simpler operator is _because_ the slot name has to be computed."
> 
> 
> How do we decide whether to use the function or the operator?
> 
> 
> Cheers,
>




[Rd] standardization of slot access
Tony Plate