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

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

[Octave-bug-tracker] [bug #55495] function loaded with autoload does not


From: Klaus Braun
Subject: [Octave-bug-tracker] [bug #55495] function loaded with autoload does not execute at the first call
Date: Wed, 16 Jan 2019 17:38:04 -0500 (EST)
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36 Edge/17.17134

URL:
  <https://savannah.gnu.org/bugs/?55495>

                 Summary: function loaded with autoload does not execute at
the first call
                 Project: GNU Octave
            Submitted by: kmb721
            Submitted on: Wed 16 Jan 2019 10:38:02 PM UTC
                Category: None
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Incorrect Result
                  Status: None
             Assigned to: None
         Originator Name: Klaus Braun
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 4.4.1
        Operating System: Any

    _______________________________________________________

Details:

I have a function file 'f_test.m' with 2 functions defined:

function f_test()
  printf("f_test is executing..\n");
endfunction

function ret = f_2()
  printf("f_2 is executing..\n");
  ret = 7;
endfunction


The first function executes as expected.
Trying to execute the 2nd function 'f_2' issues an error as expected.
Then I use "autoload('f_2', 'f_test.m')" to load the 2nd function.
When I then call f_2 there is no more error as expected and all seems to be
ok, but the function does *Nothing*.
Only the second (and subsequent) call does execute the code in f_2.

Here is the sequence in the command window:

>> f_test
f_test is executing..
>> f_2
error: 'f_2' undefined near line 1 column 1
>> autoload('f_2', 'f_test.m')
warning: autoload: 'f_test.m' is not an absolute filename
>> f_2
>> f_2
f_2 is executing..
ans =  7
>>


In my opinion this is a bug - or am I doing something wrong?
To repeat this phenomena you have to close octave and restart it again, or use
"autoload('f_2', 'f_test.m', 'remove')" to unload f_2.






    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?55495>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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