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

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

[Octave-bug-tracker] [bug #35881] clear all removes subfunctions


From: Julien Bect
Subject: [Octave-bug-tracker] [bug #35881] clear all removes subfunctions
Date: Tue, 03 May 2016 12:38:05 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0

Follow-up Comment #9, bug #35881 (project octave):

Following-up to my previous comment (#8):

Sergey Plotnikov's experiment seems to contradict the documentation, since it
appears from his result that the call to clear() inside testpersist() clears
the persistent in testpersist(), with a delay.

However, repeating the experiment today in R2016a I obtain a different result,
which is in line with the documentation:

>> type testpersist
function testpersist
  persistent x;
  x
  if isempty(x)
    x = 1;
  end
  clear('functions');
  x
end

>> testpersist
x =
     []
x =
     1

>> testpersist
x =
     1
x =
     1


My interpretation is that in Matlab R2016a, as the documentation says, the
current function is *not* cleared by clear ('functions').  The difference with
Sergey's result is perhaps due a difference of versions.

In Octave (tested in 4.0.2), the current function *is* cleared by clear
('functions').


    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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