octave-maintainers
[Top][All Lists]
Advanced

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

Re: Need test run in Matlab


From: John W. Eaton
Subject: Re: Need test run in Matlab
Date: Wed, 18 Dec 2019 12:51:33 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0

On 12/18/19 12:37 PM, John W. Eaton wrote:
On 12/18/19 10:11 AM, Juan Pablo Carbajal wrote:

These are the results

Thanks.

after I modified f1 and f2 (attached; Matlab
2019a doesn't  accept declaration of persistent and initialization in
the same line)

Oops.

It looks like the private function is loaded the first time it is used and then also cleared by the "clear functions" command.  But then it also remains available through the handle.  So I'm wondering whether the handle should retain a reference to the function and "clear functions" should only remove it from thh symbol table, or whether it should be reloaded if it becomes invalid.  I'm thinking the first option would be best unless someone knows of a reason to do otherwise.

Here's another test to run to see whether keeping a reference to the function in the handle will be compatible with Matlab behavior: unpack the attached file and execute the following commands in Matlab:

cd fh-bug
fh = f1
fh()         %% should display "foo-i-hithere: 1"
f2           %% should display "foo-i-hithere: 2"
clear functions   %% what will happen with persistent value in "gg"?
fh()         %% does this display "... 3" or "... 1"?
f2           %% does this display "... 1" or "... 2" or ?

jwe

Attachment: fh-bug.tar.gz
Description: application/gzip


reply via email to

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