Re: [R] Block comment?

2017-09-02 Thread William Dunlap via R-help
Is the reason you want a block comment containing code (as opposed to
arbitrary text) that you want to be able to easily run the commented out
code?  If so the 'if()' construct has the advantage that you only need to
change code at the start of the comment, not at both ends.

The if(FALSE) could be if(isTRUE(getOption("DEBUG_ISSUE_XYZ"))) so you
would not even have to change code to re-enable the debugging code, just
call options(DEBUG_ISSUE_XYX=TRUE)).


Bill Dunlap
TIBCO Software
wdunlap tibco.com

On Sat, Sep 2, 2017 at 7:54 AM, Suzen, Mehmet  wrote:

> AFAIK block comment is not possible
> it needs to be implemented in R interpreter and defined in the
> parser.'If' solution is not elegant.
>
> On 2 September 2017 at 14:09, Uwe Ligges
>  wrote:
> >
> >
> > On 02.09.2017 11:40, Christian wrote:
> >>
> >> I consider it quite worth while to introduce into R syntax a nestable
> >> block comment like
> >>
> >> #{
> >> 
> >> }#
> >
> >
> > if(FALSE){
> > 
> > }
> >
> > Best,
> > Uwe Ligges
> >
> >
> >> It would make documentation more easily manageable and lucid.
> >> Is there considerable need for this.
> >>
> >> Please, comment on this.
> >> How about R core?
> >>
> >> Christian
> >
> >
> > __
> > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide http://www.R-project.org/
> posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/
> posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Block comment?

2017-09-02 Thread Jeff Newmiller
I agree, since one reason for block commenting is to include 
syntactically-invalid information (such as broken code) in the source code.

However, block commenting is not wholly a good thing, as both the R parser and 
human coders often find it challenging to identify where the end of the block 
is, making it difficult to tell whether you are looking at live code or 
comments.  A good editor can add/remove comment marks to "blocks" of lines of 
code, relieving the programmer of tedium while maintaining clarity about which 
lines are active or not.

Block commenting is also a bit of a cultural thing, like using or avoiding tab 
characters in code, or vi-vs-emacs... it is hard to change people's minds about 
it, and potentially inflammatory to try. I think it is safe to say that the 
designers of R were aware of block commenting and consciously chose to not 
include it in the language.
-- 
Sent from my phone. Please excuse my brevity.

On September 2, 2017 7:54:18 AM PDT, "Suzen, Mehmet"  wrote:
>AFAIK block comment is not possible
>it needs to be implemented in R interpreter and defined in the
>parser.'If' solution is not elegant.
>
>On 2 September 2017 at 14:09, Uwe Ligges
> wrote:
>>
>>
>> On 02.09.2017 11:40, Christian wrote:
>>>
>>> I consider it quite worth while to introduce into R syntax a
>nestable
>>> block comment like
>>>
>>> #{
>>> 
>>> }#
>>
>>
>> if(FALSE){
>> 
>> }
>>
>> Best,
>> Uwe Ligges
>>
>>
>>> It would make documentation more easily manageable and lucid.
>>> Is there considerable need for this.
>>>
>>> Please, comment on this.
>>> How about R core?
>>>
>>> Christian
>>
>>
>> __
>> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide
>http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>
>__
>R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide
>http://www.R-project.org/posting-guide.html
>and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Block comment?

2017-09-02 Thread Bert Gunter
Uwe showed an R code -ish way to do it. RStudio and probably other R UI's
and IDE's -- which is the way most folks write code, I think -- also make
it easy to do.

Cheers,
Bert




Bert Gunter

"The trouble with having an open mind is that people keep coming along and
sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )

On Sat, Sep 2, 2017 at 7:54 AM, Suzen, Mehmet  wrote:

> AFAIK block comment is not possible
> it needs to be implemented in R interpreter and defined in the
> parser.'If' solution is not elegant.
>
> On 2 September 2017 at 14:09, Uwe Ligges
>  wrote:
> >
> >
> > On 02.09.2017 11:40, Christian wrote:
> >>
> >> I consider it quite worth while to introduce into R syntax a nestable
> >> block comment like
> >>
> >> #{
> >> 
> >> }#
> >
> >
> > if(FALSE){
> > 
> > }
> >
> > Best,
> > Uwe Ligges
> >
> >
> >> It would make documentation more easily manageable and lucid.
> >> Is there considerable need for this.
> >>
> >> Please, comment on this.
> >> How about R core?
> >>
> >> Christian
> >
> >
> > __
> > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide http://www.R-project.org/
> posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/
> posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Block comment?

2017-09-02 Thread Suzen, Mehmet
AFAIK block comment is not possible
it needs to be implemented in R interpreter and defined in the
parser.'If' solution is not elegant.

On 2 September 2017 at 14:09, Uwe Ligges
 wrote:
>
>
> On 02.09.2017 11:40, Christian wrote:
>>
>> I consider it quite worth while to introduce into R syntax a nestable
>> block comment like
>>
>> #{
>> 
>> }#
>
>
> if(FALSE){
> 
> }
>
> Best,
> Uwe Ligges
>
>
>> It would make documentation more easily manageable and lucid.
>> Is there considerable need for this.
>>
>> Please, comment on this.
>> How about R core?
>>
>> Christian
>
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Block comment?

2017-09-02 Thread Uwe Ligges



On 02.09.2017 11:40, Christian wrote:
I consider it quite worth while to introduce into R syntax a nestable 
block comment like


#{

}#


if(FALSE){

}

Best,
Uwe Ligges



It would make documentation more easily manageable and lucid.
Is there considerable need for this.

Please, comment on this.
How about R core?

Christian


__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.