bugGNU Octave - Bugs: bug #39827, "clear PATTERN" should...

 
 

bug #39827: "clear PATTERN" should not clear functions when PATTERN contains wildcards

Submitted by:  Julien Bect <jbect>
Submitted on:  Tue 20 Aug 2013 03:31:50 PM UTC  
 
Category: InterpreterSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Matlab Compatibility
Status: NoneAssigned to: None
Originator Name: Julien BectOpen/Closed: Open
Release: devOperating System: GNU/Linux

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

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

 

Tue 20 Aug 2013 03:31:50 PM UTC, original submission:

In Octave, `clear *' removes all variables and functions from the current workspace.

In Matlab (R2012a) `clear *' removes variables but not functions.

Similarly, if we assume that a function `g' is defined:

In Octave, both `clear g' and `clear g*' delete `g'.

In Matlab (R2012a), `clear g' deletes `g' but `clear g*' leaves `g' untouched.

The same is true for `?'.

As a general rule for describing this, I would say that `clear PATTERN' only affects variables (not functions), except for the special where 1) PATTERN contains no wildcards, and 2) PATTERN is not a variable name, in which case `clear PATTERN' can be seen as a shortcut for `clear functions PATTERN'.

I don't know if the is true in the most recent release of Matlab (R2013a) since the documentation of `clear' does not mention wildcards any more:

http://www.mathworks.fr/fr/help/matlab/ref/clear.html
http://www.mathworks.fr/fr/help/matlab/ref/clearvars.html

Julien Bect <jbect>

 

(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 jbect (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):

     

     

    No Changes Have Been Made to This Item

    Back to the top


    Powered by Savane 3.1-cleanup