[R] Random number generation
Esmail Bonakdarian
esmail.js at gmail.com
Tue May 13 16:12:31 CEST 2008
Greg Snow wrote:
>> -----Original Message-----
>> From: r-help-bounces at r-project.org
>> [mailto:r-help-bounces at r-project.org] On Behalf Of Esmail Bonakdarian
>> Sent: Sunday, May 11, 2008 7:25 AM
>> To: Prof Brian Ripley
>> Cc: r-help at stat.math.ethz.ch
>> Subject: Re: [R] Random number generation
>
> [snip]
>
>> What I read doesn't seem to be incorrect however (it may even
>> have been an archived message here), the *language* itself
>> does not seem to support block *comments*. Using conditional
>> constructs, or an IDE/editor to achieve similar results is a
>> work around - but not the same. I don't mean to nitpick, but
>> as a computer scientist I see this as different :-)
>
> I am not a computer scientist, so correct me if I am wrong, but from what I remember (and a quick glance at my copy of Kernighan Ritchie), the C *language* itself does not support block *comments*, rather the preproccessor
Hi there,
Yes, while that may be true, many other languages that don't use an
explicit pre-processor mechanism (though internally will go
through a similar process) do support block comments. It's a
moot point anyway, since when you compile a C program the preprocessor
also runs (just like the linker etc) unless you specifically ask for
something differently via command line switches. As far as the
programmer is concerned the semantics are those of a language
that provides block comments with the simple use of /* */ , and
not dependent on if-statements or editor/IDE tricks.
> Since R is optimized for interactive use rather than compilation, running everything through a preproccessor is not really an option. However as an additional work around
My use then may be not typical since I am trying to write scripts in R
and only use R directly to try out functions/language constructs.
> you could always run your R scripts through the C preproccessor and
> have it strip the block comments for you.
Too much work, call me old school, but I like the computer do work for me,
rather than the other way around :-)
> Given the complexity of implementing block commenting (even deciding on the syntax) and the ease of current work arounds, the cost benefit ratio probably puts this very near the bottom of the priority list.
I couldn't possibly offer an opinion on that .. I'll happily defer to you
and the other experts here for this.
Cheers,
Esmail
More information about the R-help
mailing list