Skip to content

a bug in R Mac GUI

9 messages · Simon Urbanek, Randy Lai, Rob Goedman

#
Hi guys,

I have fixed a bug in R Mac GUI that the comment symbol # is trimmed when cleanup history entries is checked.
This only works for R 3.0.x for Mac.

 A complied version can be found in the following link.

the fix: https://github.com/randy3k/R-Mac-GUI/commit/d8d387236b208d49b3cda9a3d82ca72e70b40110
the binary: https://github.com/randy3k/R-Mac-GUI/releases
3 days later
#
I'm CCig Rob since he designed the history code so he may comment on whether it's by design or not. I dimly remember that this was intended, but I'm not 100% sure.

Thanks,
Simon


Begin forwarded message:
#
I would rather think that it is a bug. It happens when "clean up history entries" is on but ?strip comment? is off.

If I have a history of two lines:
# this is a comment
a = 100

the current version of GUI would returns
this is a comment
a = 100
On Nov 5, 2013, at 5:49 AM, Simon Urbanek <simon.urbanek at r-project.org> wrote:

            
#
Hi Simon and Randy,

Randy, what do you mean with 'I have a history'? How did you create your example? I can't reproduce the problem (but I'm on R-devel and compile everything locally, including R.app). 

That would indeed be pretty serious as most of my source files contain comments as in your example.

Simon, I'm not 100% sure either (h?, it was 10 years ago!), but I think we decided to stay as close as possible to the behavior of the Carbon version of R.app, although I believe I opted for removing comment-only lines. Of course, that's just a decision. And different from Randy's example just now.

Rob J. Goedman
goedman at icloud.com
On Nov 5, 2013, at 9:34 AM, Randy Lai <randy.cs.lai at gmail.com> wrote:

            
#
I have made a youtube video to explain the bug.
http://www.youtube.com/watch?v=-9Qtjq7ratE
On Nov 5, 2013, at 10:15 AM, Robert J Goedman <goedman at icloud.com> wrote:

            
#
I am using Apple LLVM version 5.0 (clang-500.2.79).
On Nov 5, 2013, at 11:35 AM, Robert J Goedman <goedman at icloud.com> wrote:

            
#
Actually, I get the warnings ?Expression result unused? and I don?t understand why there are such flags.
On Nov 5, 2013, at 1:12 PM, Randy Lai <randy.cs.lai at gmail.com> wrote:

            
#
Well, I guess I know what it meant.

We should ignore the initialization part of the for loop, i.e., to use

    for (; location < length; location++) {

and 

    for (; length > 0; length--) {


Actually, there is an other minor bug.
When both ?clean up history entries? and ?strip comment? are off, an new line symbol is added to every history.
On Nov 5, 2013, at 1:19 PM, Randy Lai <randy.cs.lai at gmail.com> wrote: