[Rd] Documentation for is.atomic and is.recursive

Martin Maechler maechler at stat.math.ethz.ch
Fri Sep 4 10:25:42 CEST 2009


>>>>> "hw" == hadley wickham <h.wickham at gmail.com>
>>>>>     on Wed, 2 Sep 2009 14:02:06 -0500 writes:

    hw> On Wed, Sep 2, 2009 at 1:54 PM, Stavros
    hw> Macrakis<macrakis at alum.mit.edu> wrote:
    >> On Wed, Sep 2, 2009 at 2:39 PM, Stavros
    >> Macrakis<macrakis at alum.mit.edu> wrote:
    >> 
    >>>      Most types of language objects are regarded as
    >>> recursive: those      which are not are the atomic
    >>> vector types, 'NULL' and symbols (as      given by
    >>> 'as.name').
    >>> 
    >>> But is.recursive(as.name('foo')) ==
    >>> is.recursive(quote(foo)) == FALSE.
    >> 
    >> Sorry, this *is* consistent with the behavior.  But if we
    >> read "the atomic vector types, 'NULL' and symbols" as a
    >> list of mutually exclusive categories, then
    >> is.atomic(NULL)==FALSE is inconsistent.

    hw> And the sentence could be more clearly written as:

    hw> Most types of language objects are regarded as
    hw> recursive, except for atomic vector types, 'NULL' and
    hw> symbols (as given by 'as.name').

yes, that's a shorter and more elegant.
But before amending that,  why 
"language objects" instead of just "R objects" or "objects" ?
  
In the context of S and R when I'd hear  "language objects",
I'd think of the results of
    expression() , formula(), substitute(), quote()
i.e., objects for which  is.language() was true.

So, I'm proposing

  Most types of objects are regarded as recursive, except for
  atomic vector types, \code{NULL} and symbols (as given by
  \code{\link{as.name}}).

--
Martin Maechler



More information about the R-devel mailing list