bugGNU Octave - Bugs: bug #29433, clear <var_name> leaves...

 
 

bug #29433: clear <var_name> leaves remnants when var_name is a global variable

Submitted by:  Rik <rik5>
Submitted on:  Sun 04 Apr 2010 12:42:57 AM UTC  
 
Category: InterpreterSeverity: 2 - Minor
Priority: 5 - NormalItem Group: Other
Status: FixedAssigned to: Jaroslav Hajek <highegg>
Originator Name: Open/Closed: Closed
Release: devOperating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Thu 08 Apr 2010 06:38:26 PM UTC, comment #2:

Your patch seems fine to me so I checked it in.

Thanks.

John W. Eaton <jwe>
Project Administrator
Wed 07 Apr 2010 06:34:10 AM UTC, comment #1:

>According to the documentation, clear <var_name> removes the variable from the local and global symbol tables.


This is not true neither in Octave nor Matlab.

octave:1> global a = 1
octave:2> clear a
octave:3> global a
octave:4> a
a = 1

It doesn't seem to me that the documentation implies otherwise. In any case, feel free to clarify it.

The observed autocompletion behavior is caused by the fact that Octave includes global variables in the completion. Alas, this is only useful to complete a possible global declaration (otherwise the globals are not visible, and afterwards they are in local scope), so maybe we shouldn't do it.

Possible patch attached.

(file #20147)

Jaroslav Hajek <highegg>In charge of this item.
Sun 04 Apr 2010 12:42:57 AM UTC, original submission:

According to the documentation, clear <var_name> removes the variable from the local and global symbol tables.

However, if the variable is global, the symbol still exists in the autocompletion buffer (reached when a word is partially typed and then <TAB> is typed to complete the string)

This behavior does not exist for local variables or if 'clear -g <var_name>' is performed.

A sample script to reproduce the bug is attached. Run with 'octave -f --persist clear_var_test.m'

Rik <rik5>
Project Administrator

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #20147:  10492.diff added by highegg (2KiB - text/x-diff)
file #20108:  clear_var_test.m added by rik5 (553B - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by jwe (Posted a comment)
  • -unavailable- added by highegg (Updated the item)
  • -unavailable- added by rik5 (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 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 08 Apr 2010 06:38:26 PM UTCjweStatusIn Progress=>Fixed
      Open/ClosedOpen=>Closed
    Wed 07 Apr 2010 06:34:29 AM UTChigheggStatusNone=>In Progress
    Wed 07 Apr 2010 06:34:10 AM UTChigheggAttached File-=>Added 10492.diff, #20147
      Assigned toNone=>highegg
    Sun 04 Apr 2010 12:42:57 AM UTCrik5Attached File-=>Added clear_var_test.m, #20108

    Back to the top


    Powered by Savane 3.1-cleanup1