octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #39827] "clear PATTERN" should not clear funct


From: Julien Bect
Subject: [Octave-bug-tracker] [bug #39827] "clear PATTERN" should not clear functions when PATTERN contains wildcards
Date: Tue, 20 Aug 2013 15:31:50 +0000
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:23.0) Gecko/20100101 Firefox/23.0

URL:
  <http://savannah.gnu.org/bugs/?39827>

                 Summary: "clear PATTERN" should not clear functions when
PATTERN contains wildcards
                 Project: GNU Octave
            Submitted by: jbect
            Submitted on: mar. 20 août 2013 15:31:50 GMT
                Category: Interpreter
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Matlab Compatibility
                  Status: None
             Assigned to: None
         Originator Name: Julien Bect
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: dev
        Operating System: GNU/Linux

    _______________________________________________________

Details:

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





    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?39827>

_______________________________________________
  Message posté via/par Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]