G'day Edna,

On Sat, 14 Mar 2009 23:00:12 -0500
Edna Bell <edna.bel...@gmail.com> wrote:

> Anyway, my question now is:  what determines if a function is a
> builtin vs. a closure, please?

The help page of typeof states that:

The possible values are listed in the structure 'TypeTable' in
'src/main/util.c'. Current values are [...]
   '"closure"' (function)
   '"special"' and '"builtin"' (basic functions and operators)

Which might raise the question what "basic functions" are.  But since
"basic" and "primitive" are synonyms it is not hard to guess that
primitive functions are returning "special" or "builtin"; and the help
page of ?is.primitive confirms this.  

Note, a return value of "special" is possible for a primitive function:
R> UseMethod
function (generic, object)  .Primitive("UseMethod")
R> typeof(UseMethod)
[1] "special"

HTH.

Cheers,

        Berwin

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to