Re: R-alpha: assignment scoping

Paul Gilbert (
Wed, 29 May 1996 10:12:14 -0400

Date: Wed, 29 May 1996 10:12:14 -0400
From: (Paul Gilbert)
Subject: Re: R-alpha: assignment scoping
Message-Id: <>

>4) Fix the whole scoping business (this is what compiler-jocks like
>   Luke are really after :-).  I like this idea too.  Perhaps all
>   that is required (Luke?) is a scoping declaration like
>	f <- function() local x=x # local x getting its value from the global
>		{ x[1] <- 3 ; x}
>   Variables not declared local must be global.
>   Of course this would break S compatibility in a major way.

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.

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

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