From ivo.welch at gmail.com  Sun Aug 22 17:33:51 2010
From: ivo.welch at gmail.com (ivo welch)
Date: Sun, 22 Aug 2010 11:33:51 -0400
Subject: [Rd] small syntax suggestion
Message-ID: <AANLkTimvja3=JJ-Y8yS=8K+m8ePP7XrCUTEvzg=L9bjn@mail.gmail.com>

Dear R development Team:  I really know very little, so you may ignore
this post.  I have found that my students often make the mistake of
mixing up comparisons and assignments with negative numbers:

  if (x<-3) do_something;

I parenthesize, but every once in a while, I forget and commit this
mistake, too.  so, I would suggest that R simply warn about an
ambiguity.  that is, it could suggest a space either between the < and
- , or after the <- .

  x< -3  ## means comparison already
  x<- 3  ## means assignment already
but warn when
  x<-3  ## ambiguity warning instead of assignment
  x<-(whatever)  ## ok

just a suggestion...

regards,

/iaw
----
Ivo Welch (ivo.welch at brown.edu, ivo.welch at gmail.com)



[Rd] small syntax suggestion
ivo welch