bugGNU Octave - Bugs: bug #40452, explicit clear will not clear...

 
 

bug #40452: explicit clear will not clear function entered on the command line

Submitted by:  None
Submitted on:  Sat 02 Nov 2013 12:41:06 PM UTC  
 
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: FixedAssigned to: None
Originator Name: AdrianOriginator Email: -unavailable-
Open/Closed: ClosedRelease: 3.6.2
Operating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sun 03 Nov 2013 11:27:42 PM UTC, comment #4:

Thanks for checking. I filed another bug report on the "type" command (bug #40462).

cheers, Adrian

Anonymous
Sun 03 Nov 2013 01:11:40 PM UTC, comment #3:

Hmmm, the syntax complaint on

doesn't show up now.... well that's better still.

As to your other request:

(on Windows & Linux) so yes that is still the behavior.

Philip Nienhuis <philipnienhuis>
Project Member
Sat 02 Nov 2013 11:29:44 PM UTC, comment #2:

Thanks Philip Nienhuis, for taking the time to look into this.

As regards your first question, have I tried "clear -f": yes, see command #6 in my OP; no effect either.

Wrt your side remark, I have no idea why 'function foo "nop"; endfunction' causes syntax complaints for you: I can define and execute this foo on 3.6.2 and 3.6.4 without complaints. But of course the precise content of foo is not important here, your suggestion produces the same result.

I upgraded to the newest version packaged for Debian, 3.6.4 (testing and unstable), and I can confirm the bug like you did on that version on Windows. Unfortunately even Debian-experimental does not have a newer version, so I'll wait until 3.77 has led to a new stable release and is packaged. Glad to hear the bug has been squashed already and can be closed.

Could you just check if 3.7.7 has also corrected the following bug, which seems also somehow related to symbol look-up:

If 3.7.7 does not show the function definition as it should, I might open a second bug-report.

Thanks again! Octave has become a really valuable piece of software for me.

Adrian

Anonymous
Sat 02 Nov 2013 01:44:11 PM UTC, comment #1:

Have you tried "clear -f"?

BTW your example:
function foo "nop"; endfunction
gets me syntax complaints.

Anyway I think you'd better upgrade - 3.6.2 is quite old.

I can confirm this behavior in 3.6.4 (on Windows). However, in the development version (3.7.7+) I see (on Linux and Windows):

so this bug has been fixed.

Philip Nienhuis <philipnienhuis>
Project Member
Sat 02 Nov 2013 12:41:06 PM UTC, original submission:

When I define a function on the command line, I do not seem to be able to clear it by specifying its name. The only way seems to clear its definition appears to be clearing everything (clear -a), as the following transcript illustrates (fresh session with empty .octaverc, on an up-to-date Debian stable (Wheezy)):

I don't know whether this is intended behaviour, but the documentation seems to suggest it is not: "For example, suppose you have defined a function foo, and then hidden it by performing the assignment foo = 2. Executing the command clear foo once will clear the variable definition and restore the definition of foo as a function. Executing clear foo a second time will clear the function definition."

Is this a problem of my installation/GNU-Linux distribution/octave version/... only, or some misunderstanding of the intended behaviour on my side, or indeed a bug ?

(I also do not seem to be able to type the function's definition ("type foo" yields "error: type: `foo' undefined"), but this is better submitted as another bug-report if this one is confirmed to be a bug).

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by None (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 02 Nov 2013 01:44:11 PM UTCphilipnienhuisStatusNone=>Fixed
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1