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 <[email protected]> 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 <[email protected]> wrote:
> 
>> I am using Apple LLVM version 5.0 (clang-500.2.79).
>> 
>> 
>> On Nov 5, 2013, at 11:35 AM, Robert J Goedman <[email protected]> wrote:
>> 
>>> HI Randy,
>>> 
>>> Got it, clearly a bug. Not sure why this was never before reported/noticed. 
>>> Thanks!
>>> 
>>> Simon, I've committed Randy's patch with one change (not sure if the 'auto' 
>>> types in the NSString (TrimmingAdditions) category will work on all 
>>> systems, so reverted back to the old fashioned way). 
>>> 
>>> Which compiler are you using Randy? In fact if I use your versions of the 2 
>>> for loops, it still shows the problem and flags both statements for results 
>>> (location, length) not being used.
>>> 
>>> Rob J. Goedman
>>> [email protected]
>>> 
>>> 
>>> 
>>> 
>>> On Nov 5, 2013, at 10:57 AM, Randy Lai <[email protected]> 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 <[email protected]> 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
>>>>> [email protected]
>>>>> 
>>>>> 
>>>>> 
>>>>> On Nov 5, 2013, at 9:34 AM, Randy Lai <[email protected]> wrote:
>>>>> 
>>>>>> 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 <[email protected]> 
>>>>>> wrote:
>>>>>> 
>>>>>>> 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:
>>>>>>> 
>>>>>>>> From: Randy Lai <[email protected]>
>>>>>>>> Subject: [R-SIG-Mac] a bug in R Mac GUI
>>>>>>>> Date: November 2, 2013 at 12:55:51 AM EDT
>>>>>>>> To: [email protected]
>>>>>>>> 
>>>>>>>> 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
>>>>>>>> 
>>>>>>>> _______________________________________________
>>>>>>>> R-SIG-Mac mailing list
>>>>>>>> [email protected]
>>>>>>>> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
>>>>>>>> 
>>>>>>> 
>>>>>> 
>>>>> 
>>>> 
>>> 
>> 
> 

_______________________________________________
R-SIG-Mac mailing list
[email protected]
https://stat.ethz.ch/mailman/listinfo/r-sig-mac

Reply via email to