Re: R-alpha: assignment scoping

Ross Ihaka (
Thu, 30 May 1996 14:46:29 +1200

Date: Thu, 30 May 1996 14:46:29 +1200
From: Ross Ihaka <>
Message-Id: <>
Subject: Re: R-alpha: assignment scoping
In-Reply-To: <>

Paul Gilbert writes:
 > Can't you make it so that variables not declared global are all
 > considered local and produce an error message if an inappropriate
 > assignment is attempted. That would only break compatibility with S in
 > places where I'm doing something I probably didn't intend to do in S.

I thought about this a while ago.  I don't think that it works.
The problem is that variables which are not local to a function
are not necessarily global.  They might be local to enclosing
function definitions (this is a major R/S difference).

 > On compatibility of R with S-plus:
 > I can go a long way in supporting my time series software to run in
 > both S and R if there is a common enough subset that I don't have to
 > maintain two separate versions. If it comes to maintaining two versions
 > I can't justify doing that. Function defaults, for example, need to be
 > the same for any function which might be called by another function
 > (but not necessary for functions which would only be called directly by
 > a user - but this does not leave out many functions). The down side of
 > changing defaults on any functions is that separate documentation is
 > required.

We will certainly try to be compatible.  Our moto is

	"As compatible as possible under the circumstances".

Sometimes it is not that easy to be compatible.  In many ways R and S
are quite similar, but under the hood the differences can be quite
large.  Sometimes we gain compatibility incrementally.

r-testers mailing list -- To (un)subscribe, send
subscribe	or	unsubscribe
(in the "body", not the subject !)  To: