From ripley at stats.ox.ac.uk  Fri Jan 16 12:21:54 2004
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Fri Jan 16 12:20:23 2004
Subject: [Rd] local variables (PR#6436)
In-Reply-To: <hsgf0053f3jsq39aa4t2l5k80cc2uht0ga@4ax.com>
Message-ID: <Pine.LNX.4.44.0401161120340.29707-100000@gannet.stats>

On Fri, 16 Jan 2004, Duncan Murdoch wrote:

> On Fri, 16 Jan 2004 11:12:31 +0100 (CET), you wrote:
> 
> >It seems that R (unlike S-plus) allows assignments to elements of a 
> >vector objects even when the object do not exists locally (inside a 
> >fucntion) in cases where an object of the same name exists globally.  I 
> >guess this is not really desired behaviour:
> 
> Please don't post things as bugs unless you're reasonably sure they're
> bugs.  This is a difference between R and S-PLUS.
> 
> It's well documented that R and S-PLUS have different scoping rules
> (see 3.3.1"Lexical Scoping" in the FAQ), but I don't think that's
> coming into play here.  
> 
> What we have is a reference to a global variable that modifies it.
> For some reason S-PLUS doesn't allow that, but R does.  Why do you
> think it's a bug in R?

Some versions of S-PLUS do not allow it, and others do, so hardly a basis 
for claiming a bug in R.

-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595


[Rd] local variables (PR#6436)
Prof Brian Ripley