[R] R is GNU S, not C.... [was "how to get or store ....."]
Patrick Burns
pburns at pburns.seanet.com
Tue Dec 6 17:21:01 CET 2005
I don't put in extraneous ';' because I maybe get a
blister on my little finger.
I suspect that those who find the semi-colons ugly in
R do not find them ugly in C. I think the reason there
would be a visceral reaction in R but not in C is that
there is a danger when using them in R that they really
mean something.
We get questions on R-help often enough about why
code like:
if(x > 0) y <- 4
else y <- 4.5e23
doesn't work.
If people habitually used semi-colons, those sorts of
questions would probably multiply.
Patrick Burns
patrick at burns-stat.com
+44 (0)20 8525 0696
http://www.burns-stat.com
(home of S Poetry and "A Guide for the Unwilling S User")
Xiaofan Li wrote:
>I consistently use ";" at every end of my R code and have found it much more
>neat than those sentences without an end; for "<-" and "=", if I were the
>author I would rather take the first representation as a sign of
>passing-by-reference while the latter by value.
>
>Xiaofan Li
>DAMTP, University of Cambridge, CB3 0WA, UK
>Tel +44 7886 614030, Email xl252 at cam.ac.uk
>
>
>-----Original Message-----
>From: r-help-bounces at stat.math.ethz.ch
>[mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of vincent at 7d4.com
>Sent: 06 December 2005 14:16
>To: rHelp
>Subject: Re: [R] R is GNU S, not C.... [was "how to get or store ....."]
>
>Martin Maechler a écrit :
>
>
>
>>please, please, these trailing ";" are *so* ugly.
>>This is GNU S, not C (or matlab) !
>>
>>but I'll be happy already if you could drop these ugly empty
>>statements at the end of your lines...
>>
>>
>
>May I disagree ?
>I find missing ";" at end of lines *so* ugly.
>Ugly/not ugly depends on our observer's eyes.
> From my programmer point of view, I prefer to mark clearly the end of the
>lines.
>In many languages, it's safer to do it this way, and I thank the R
>developers to permit it.
>(in my opinion, it should even be mandatory).
>(By the way, marking the end of lines with a unique symbol makes also the
>job easier for the following treatment.) And yes, I'm also a C programmer
>;-)
>
> > {and I have another chain of argments why "<-" is so more
> > expressive than "="
>
>Why "<-" seems better than "=" is also quite mysterious for me.
>There was a discussion about this point recently I think.
>I believe in 99% of cases it's more for historical reason (and perhaps also
>for some "snob" reasons).
>
>I am not at all a 20 years experienced R programmer, but I have written
>several hundreds of R lines those 6 last months, and until today didn't get
>any problem using "=" instead of "<-".
>
>But I'll read your chain of arguments with interest.
>
>______________________________________________
>R-help at stat.math.ethz.ch mailing list
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide!
>http://www.R-project.org/posting-guide.htmle.html
>
>______________________________________________
>R-help at stat.math.ethz.ch mailing list
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>
>
>
>
>
More information about the R-help
mailing list