From simon.urbanek at r-project.org  Mon Apr 11 17:46:20 2011
From: simon.urbanek at r-project.org (Simon Urbanek)
Date: Mon, 11 Apr 2011 11:46:20 -0400
Subject: [Rd] Wish there were a "strict mode" for R interpreter. What
In-Reply-To: <EDD2DF2D-1D22-4650-9366-B915B2C79ADB@stat.ubc.ca>
References: <XFMail.110409220813.ted.harding@wlandres.net>
	<EDD2DF2D-1D22-4650-9366-B915B2C79ADB@stat.ubc.ca>
Message-ID: <C6D0A838-2ED1-49B5-84BB-2FA05D79F84F@r-project.org>


On Apr 11, 2011, at 11:28 AM, Davor Cubranic wrote:

> On 2011-04-09, at 2:08 PM, Ted Harding wrote:
> 
>> I think the right thing to so is to introduce the students to the
>> basics of scoping, early in the process of learning R.
> 
> I know the basics of scoping perfectly well, but that doesn't stop me from occasionally misspelling a variable name that only causes an error much later.
> 
> OTOH, I think with Perl you can start declaring your variables "local" and keep the interpreter happy. But in R's context you then have to also start declaring what you expect to inherit from parent environments, and pretty soon the code is so encrusted with annotation barnacles that it loses the simplicity that  makes R so nice in the interactive mode. 
> 
> What would be really nice is if we had a smart R editor/IDE that would "DWIM" and put a red underline under a misspelled name, but leave it alone when, as Duncan said, it's in the environment. 
> 

... which is, of course, impossible since the editor has no idea what environment you will evaluate the function in ... It can make assumptions but they may as wrong as the spurious warnings discussed so people will complain either way ;)

Cheers,
Simon



[Rd] Wish there were a "strict mode" for R interpreter. What
Simon Urbanek