From mick.jordan at oracle.com  Sun Apr 10 00:54:25 2016
From: mick.jordan at oracle.com (Mick Jordan)
Date: Sat, 9 Apr 2016 15:54:25 -0700
Subject: [Rd] Note: no visible definition
In-Reply-To: <57095445.40608@gmail.com>
References: <57093BD6.1020509@oracle.com>
	<22281.16829.798454.734718@max.nulle.part>
	<57095031.5060802@oracle.com> <57095445.40608@gmail.com>
Message-ID: <57098821.3030902@oracle.com>

On 4/9/16 12:13 PM, Duncan Murdoch wrote:
> On 09/04/2016 2:55 PM, Mick Jordan wrote:
>> On 4/9/16 10:54 AM, Dirk Eddelbuettel wrote:
>>> On 9 April 2016 at 10:28, Mick Jordan wrote:
>>> | Can someone explain a message of this form from an rscript execution:
>>> |
>>> | Note: no visible global function definition for 'foo'
>>> |
>>> |
>>> | This happens right at the start of execution. 'foo' is only 
>>> executed in
>>> | a branch of an 'if' that is not reached with the particular arguments
>>> | passed to the script. If I source the script in a shell and run it 
>>> I do
>>> | not get the message.
>>>
>>> Guess: your shell session has an object foo. It will be referenced.
>>>
>>> Your Rscript, running from 'empty' never defines foo.  And codetools 
>>> tells
>>> you that because more often than not it is error.  Sometimes 
>>> codetools gets
>>> it wrong too, ie with you peek into data structure via evaluation 
>>> tricks or
>>> with simple with(mydataframe, columnOne).
>>>
>>>
>> No, the symbol is acytually defined in a package that is not loaded when
>> running under GnuR.  But I still don't understand what is even trying to
>> find the symbol in an execution path that doesn't reference it. I'm not
>> sure what you mean by codetools, but is it examining my source code
>> somehow before it is executed? That would be unexpected at best.
>
> That message comes from the compiler package, so presumbly you (or 
> Rscript) are trying to compile something.  You can't have undefined 
> references in compiled code.
>
> Duncan Murdoch
>
Ah, so if the jit is enabled that would do it? we are no explicitly 
compiling anything but it turns out I was setting R_ENABLE_JIT (accidently).

Mick



[Rd] Note: no visible definition
Mick Jordan