To put a little more concrete example into what Peter and Ben said
about the environment being key:
environment(c)
# NULL This is a primitive, so it has no environment
environment(library)
# Built-in function but it has an
environment (usually the namespace of the package whence it comes)
But
On Thu, Jan 19, 2012 at 1:45 PM, Ajay Askoolum wrote:
> The "R Language Definition" at
> http://cran.r-project.org/doc/manuals/R-lang.html states in the following
> section
>
> 4.3.2 Argument matching
> This subsection applies to closures but not to primitive functions.
>
> What are 'closures'?
On Thu, Jan 19, 2012 at 1:15 PM, Ajay Askoolum wrote:
>
>
> Thanks for clarifying.
>
> Is my (new) understanding stated below correct?
No.
-- Bert
>
> - A closure is any function (user- or system- defined) where
> is.primitive(functionName) is FALSE.
>
> - is.primitive(functionName) is FALSE wh
On Jan 19, 2012, at 21:39 , Ben Bolker wrote:
> Ajay Askoolum yahoo.co.uk> writes:
>
>>
>> Michael, thank you, especially for the link. I think I understand.
>>
>> The vocabulary is so different! I know 'closure' as 'user-defined function'.
>>
>
> Not quite. All (??) user-defined function
Thanks for clarifying.
Is my (new) understanding stated below correct?
- A closure is any function (user- or system- defined) where
is.primitive(functionName) is FALSE.
- is.primitive(functionName) is FALSE when functionName is a system-defined
function that is coded in R itself.
[[
Ajay Askoolum yahoo.co.uk> writes:
>
> Michael, thank you, especially for the link. I think I understand.
>
> The vocabulary is so different! I know 'closure' as 'user-defined function'.
>
Not quite. All (??) user-defined functions are closures, but lots
of non-user-defined functions are c
Michael, thank you, especially for the link. I think I understand.
The vocabulary is so different! I know 'closure' as 'user-defined function'.
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailm
http://www.lemnica.com/esotericR/Introducing-Closures/
Any function you work with will be a closure -- primitives are
built-in functions that users can't create. (without source editing &
recompiling R) E.g. the function c() (type it without parentheses at
the prompt to see its "code")
Let me kno
The "R Language Definition" at
http://cran.r-project.org/doc/manuals/R-lang.html states in the following
section
4.3.2 Argument matching
This subsection applies to closures but not to primitive functions.
What are 'closures'?
[[alternative HTML version deleted]]
__
9 matches
Mail list logo