[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Desired behavior for bug #38485: using 'run history' twice
From: |
Daniel J Sebald |
Subject: |
Re: Desired behavior for bug #38485: using 'run history' twice |
Date: |
Fri, 08 Mar 2013 21:48:11 -0600 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.24) Gecko/20111108 Fedora/3.1.16-1.fc14 Thunderbird/3.1.16 |
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?
For help I'm seeing:
-- Command: run SCRIPT
-- Function File: run (SCRIPT)
Run scripts in the current workspace that are not necessarily on
the path. If SCRIPT is the script to run, including its path, then
`run' changes the directory to the directory where SCRIPT is
found. `run' then executes the script, and returns to the original
directory.
The above isn't the best description. I think what is meant is a script
file. So the argument is expecting a file name. But "history" is not a
file name.
octave:21> run history
octave:22> run history
octave:23> disp(1); run history; run history
1
Instead something like
octave:29> run 'foo.cc'
seems to run the scripts inside 'foo.cc'.
Dan