[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Octave-maintainers Digest, Vol 84, Issue 21
From: |
Rik |
Subject: |
Re: Octave-maintainers Digest, Vol 84, Issue 21 |
Date: |
Sat, 09 Mar 2013 14:54:58 -0800 |
On 03/09/2013 09:10 AM, address@hidden wrote:
> Message: 4
> Date: Sat, 09 Mar 2013 00:44:33 -0600
> From: Daniel J Sebald <address@hidden>
> To: Sander van Rijn <address@hidden>
> Cc: address@hidden
> Subject: Re: Desired behavior for bug #38485: using 'run history'
> twice
> Message-ID: <address@hidden>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> On 03/08/2013 09:48 PM, Daniel J Sebald wrote:
>> > On 03/08/2013 07:16 PM, Sander van Rijn wrote:
>>> >>
>>> >> Fri 08 Mar 2013 06:00:09 AM CET, *original submission:*
>>> >> <https://savannah.gnu.org/bugs/?38485#comment0>
>>> >>
>>> >> Using 'run history' twice in a row leads to a segfault. The first
>>> >> invocation runs the previous command, whatever it was. The second
>>> >> invocation executes the previous command which is 'run history' and an
>>> >> infinite loop is generated. This isn't a common occurrence, but it isn't
>>> >> great behavior by the interpreter either.
>>> >>
>>> >> Sample Code:
>>> >>
>>> >> disp (1); run history run history
>>> >>
>>> >>
>>> >>
>>> >> What would be the desired behavior in this case? An error about causing
>>> >> an infinite loop or a recursive implementation which would make second
>>> >> 'run history' in the sample code also execute 'disp (1);' ?
>> >
>> > I can't replicate this problem. What is "run history" supposed to do?
> Oh, run_history, with an underscore. Yes, I see there is a problem
> there. I'm inclined to say recursive implementation, but could that run
> into stack issues thereby requiring some error checking also or leave it
> open to potentially crash? Have to think this one over.
>
> I point out that the help documentation for "run_history" could be
> improved as well. Anyway, there may be a bug in the run_history whereby
> the most recent history entry can't be accessed by number:
>
> octave:24> history -5
> 1048 1
> 1049 2
> 1050 3
> 1051 4
> 1052 history -5
> octave:25> run_history 1052
> error: run_history: history specification out of range
>
> The second most recent can be accessed though:
>
> octave:29> history -5
> 1054 6
> 1055 7
> 1056 8
> 1057 9
> 1058 history -5
> octave:30> run_history 1057
> ans = 9
>
> Lastly, the non-argument version of "history" doesn't seem of much use.
> Is the following what it is supposed to do?
>
> octave:34> history
> 1063 history
> octave:35> history
> 1064 history
>
> I would think that a full listing of history would be a more useful
> thing to display, or at least default the list to, say, 25 entries.
>
> Dan
3/9/13
Dan,
Which Mercurial changeset are you running? I improved both the
documentation and fixed the off-by-1 error, and it was while coding there
that I noticed this issue.
history with no arguments used to return all history starting from command
#1. I think that is a regression although I didn't touch that part of the
code. I'll take a look though.
--Rik
- Re: Octave-maintainers Digest, Vol 84, Issue 21,
Rik <=