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

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

[Octave-bug-tracker] [bug #52980] clear in the caller workspace doesn't


From: anonymous
Subject: [Octave-bug-tracker] [bug #52980] clear in the caller workspace doesn't clear all references to a variable.
Date: Sat, 27 Jan 2018 11:22:12 -0500 (EST)
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:51.0) Gecko/20100101 Firefox/51.0

Follow-up Comment #2, bug #52980 (project octave):

Analyzing the code line by line:


function f(A)


A reference to the array `V` is created and it is assigned to `A`. Now we have
one array object and two references `A` and `V`.


evalin('caller', 'clear V')


One of the references say `V` is deleted. Now we have one array object and one
reference to it say `A`.


A(1) = 5;

        
Here `A` is modified _in-place_ so no copy should be made. Also the function
returns nothing so we don't have `ans`. Finally we should have one array
object that `A` refers to it.

I think there may be a reference to the array object in the caller workspace
that has not been cleared, so when `A` is modified a copy of the object is
created.

Thanks.

    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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