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: Michael Goffioul
Subject: [Octave-bug-tracker] [bug #35881] clear all removes subfunctions
Date: Tue, 15 Oct 2013 12:12:41 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.66 Safari/537.36

Update of bug #35881 (project octave):

             Open/Closed:                  Closed => Open                   
                 Release:                   3.6.1 => dev                    
        Operating System:               GNU/Linux => Any                    

    _______________________________________________________

Follow-up Comment #5:

Re-opening bug. This problem popped up when trying the IRIS toolbox. This
toolbox uses a pattern like:


function testnestfun

  persistent x;

  if isempty(x)
    x = 1;
  end

  disp('testnestfun');
  clear('functions');
  nestfun;
  subfun;

  function nestfun
    disp ('nestfun');
  end

end

function subfun
  disp('subfun');
end


I suppose Matlab keeps a reference to the sub-/nested functions while the main
function is executing so they're still visible after the "clear" call.

As a side note, it would be interesting to know what happens to the persistent
variable after the clear call. More testing required, but I don't have access
to Matlab, so I can't tell.


    _______________________________________________________

Reply to this item at:

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

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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