From ripley at stats.ox.ac.uk  Tue Apr 17 09:12:49 2007
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Tue, 17 Apr 2007 08:12:49 +0100 (BST)
Subject: [Rd] args / formals on primitives
In-Reply-To: <200704161853.07237.thomas.friedrichsmeier@ruhr-uni-bochum.de>
References: <200704161853.07237.thomas.friedrichsmeier@ruhr-uni-bochum.de>
Message-ID: <Pine.LNX.4.64.0704161823240.10009@gannet.stats.ox.ac.uk>

On Mon, 16 Apr 2007, Thomas Friedrichsmeier wrote:

> On SVN revision 41087:

which is over 100 old.

Now we are in code freeze, the pace of change should reduce considerably 
(although people will continue to work in R-devel)

> ?args has this example line:
>
> args(c)            # -> NULL (c is a 'primitive' function)
>
> The comment seems out of date, as args(c) does in fact have a non-NULL return
> value:
>
> args(c)
> # function (..., recursive = FALSE)
> # NULL

That has been fixed once but the fix seems to have got lost, so I have put 
in back.

> While at it, I was wondering, why
>
> formals(c)
>
> still returns NULL, in contrast.

Because only closures have formals, the way things are defined.  This 
makes sense to me as formals<-() cannot work on primitives.

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



[Rd] args / formals on primitives
Prof Brian Ripley