Skip to content
Prev 343207 / 398506 Next

"no visible binding for global variable" and with() vs. within()

On 16/08/2014, 9:36 PM, Daniel Braithwaite wrote:
I'm not sure, but I suspect it's an intentional inconsistency.  The code
that checks for use of globals can't do anything in with() or within()
code, so bugs can slip by if you use those.  I think with() had been
around for a long time and was in wide use when that test was added, but
within() is newer, and it was less disruptive to warn about it, so the
warning has been left in.  (I don't remember whether the test came
before or after within() was introduced.)

So if you want to avoid the warning, don't use within().

Duncan Murdoch