bugGNU Octave - Bugs: bug #62001, feval does not work for static...

 
 

bug #62001: feval does not work for static class methods (does on Matlab)

Submitter:  Richard <crobar>
Submitted:  Mon 07 Feb 2022 12:35:59 PM UTC
   
 
Category:  Classdef Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Confirmed Assigned to:  None
Originator Name:  Open/Closed:  * Open
Release:  * dev Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 04 Mar 2022 10:15:25 PM UTC, comment #3: 

I think this should be split into two bug reports. Unless you think the scope issue is related to the feval issue?

Richard <crobar>
Tue 08 Feb 2022 05:42:25 AM UTC, comment #2: 

Confirmed.  Changing to the "dev" release since the issue is still present there and it will need to be fixed there first.

It seems that the class name, which amounts to a scope operator, is ignored.  I tried this code


classdef test_feval_static_method_with_name_ls

    methods (Static)

        function x = ls ()

            x = 1;

        end

    end

end


and when executing


feval ('test_feval_static_method_with_name_ls.ls')


the actual function that gets executed is from ls.m.

Rik <rik5>
Group administrator
Mon 07 Feb 2022 12:39:52 PM UTC, comment #1: 

It is perhaps a separate bug report, but I also came across this weird behavior while testing:


classdef test_feval_static_method_with_name_test

    methods (Static)

        function x = test ()

            x = 1;

        end

    end

end




octave:11> test_feval_static_method_with_name_test.test
ans = 1.0000e+000
octave:12> feval ('test_feval_static_method_with_name_test.test')
error: Invalid call to test.  Correct usage is:

 -- test NAME
 -- test NAME quiet|normal|verbose
 -- test ("NAME", "quiet|normal|verbose", FID)
 -- test ("NAME", "quiet|normal|verbose", FNAME)
 -- SUCCESS = test (...)
 -- [N, NMAX, NXFAIL, NBUG, NSKIP, NRTSKIP, NREGRESSION] = test (...)
 -- [CODE, IDX] = test ("NAME", "grabdemo")
 -- test ([], "explain", FID)
 -- test ([], "explain", FNAME)

Additional help for built-in functions and operators is
available in the online version of the manual.  Use the command
'doc <topic>' to search the manual index.

Help and information about Octave is also available on the WWW
at https://www.octave.org and via the help@octave.org
mailing list.
stopped in print_usage at line 86 [/usr/local/share/octave/6.4.1/m/help/print_usage.m]
86:     error ("Octave:invalid-fun-call",


Richard <crobar>
Mon 07 Feb 2022 12:35:59 PM UTC, original submission:  



classdef test_feval_static_method

    methods (Static)

        function x = return_one ()

            x = 1;

        end

    end

end



octave:7> test_feval_static_method.return_one
ans = 1.0000e+000
octave:8> feval ('test_feval_static_method.return_one')
error: feval: function 'test_feval_static_method.return_one' not found
octave:9> eval ('test_feval_static_method.return_one')
ans = 1.0000e+000


Richard <crobar>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by crobar (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-03-04 mmuetzel Carbon-CopyRemoved 102357 -
    2022-03-04 mmuetzel CategoryInterpreter Classdef
    2022-02-08 rik5 StatusNone Confirmed
        Release6.4.0 dev

    Back to the top

    Powered by Savane 3.14-79a4.
    Corresponding source code