[R] recover lost global function

luke-tierney at uiowa.edu luke-tierney at uiowa.edu
Thu Apr 5 16:58:24 CEST 2012


The compiler doesn't currently look beyond the first definition found
(the generated code does the right thing, but the compiler won't
optimize calls to functions masked by non-functions).  I'll look into
whether thechecking can be made to take this into account; it may be
more trouble than it is worth though.

luke

On Thu, 5 Apr 2012, Sam Steingold wrote:

>> * Duncan Murdoch <zheqbpu.qhapna at tznvy.pbz> [2012-04-04 21:46:57 -0400]:
>>
>> On 12-04-04 5:15 PM, Sam Steingold wrote:
>>>> * Duncan Murdoch<zheqbpu.qhapna at tznvy.pbz>  [2012-04-04 17:00:32 -0400]:
>>>>
>>>> There's no warning when you mask a function with a non-function at top
>>>> level, and little need for one, because R does the right search based on
>>>> the fact that you're making a function call:
>>>>
>>>>> c
>>>> [1] 1
>>>>> c(1,2)
>>>> [1] 1 2
>>>
>>> why then am I getting these warnings from cmpfile?
>>
>> You would have to tell me what you did before I could attempt to answer
>> that.
>
> all <- 1
> cmpfile("foo.R")
>
> where foo.R contains functions which call all()
>
>
>
>>>
>>> Note: no visible global function definition for 'all'
>>> Note: no visible global function definition for 'all'
>>> Note: no visible global function definition for 'all'
>>> Note: no visible global function definition for 'all'
>>> Note: no visible global function definition for 'all'
>>> Note: no visible global function definition for 'all'
>>> Note: no visible global function definition for 'all'
>>> Note: no visible global function definition for 'all'
>>> Note: no visible global function definition for 'all'
>>> Note: no visible global function definition for 'all'
>>>
>>> I did overwrite all to a data frame, but it only appears in a funtion
>>> position all(...) in the file being compiled.
>>>
>>
>
>

-- 
Luke Tierney
Chair, Statistics and Actuarial Science
Ralph E. Wareham Professor of Mathematical Sciences
University of Iowa                  Phone:             319-335-3386
Department of Statistics and        Fax:               319-335-3017
    Actuarial Science
241 Schaeffer Hall                  email:   luke-tierney at uiowa.edu
Iowa City, IA 52242                 WWW:  http://www.stat.uiowa.edu



More information about the R-help mailing list