[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #45444] Private functions inside namespace and
From: |
Amro |
Subject: |
[Octave-bug-tracker] [bug #45444] Private functions inside namespace and class directories |
Date: |
Sat, 24 Jun 2017 09:17:08 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (Windows NT 10.0; WOW64; rv:54.0) Gecko/20100101 Firefox/54.0 |
Follow-up Comment #5, bug #45444 (project octave):
Thanks John.
Inspired by the test case submitted by @gyom in #51276, I created a more
extensive set of tests to cover more cases. The files can be found here:
https://github.com/amroamroamro/test_functions_scope
To run, cd into each directory one at a time, then run the scripts
+myclass_test+ and +myclass_test_handles+ (you'll need to perform "clear
-c"/"clear all" in between).
Here are the things covered in the tests:
* class defined in a self-contained file, versue class defined in @-folder
(I'm referring to "classdef" style of classes)
* class inside +package folder and class inside nested packages
+package/+subpackage (both cases of classes, self contained and @-folder)
* different kinds of functions: method function, nested function, static
function, local function, private function
* in the case of @-folder class, test functions defined directly inside the
class file or in an external separate m-file inside the folder
* testing both calling functions directly, or by returning a function handle
I ran the tests in MATLAB R2017a, no errors.
I then tried in Octave 4.2.1, here's a list of things that are apparently
broken:
* defining +local_fuction+ inside a classdef file isn't supported.
* this syntax doesnt work: address@hidden, instead we have to use:
+@(varargin) myclass.static_function(varargin{:})+
* same thing when using an object: address@hidden or
address@hidden
* in some case calling methods as +obj.method_function()+ doesnt work right,
instead we have to use +method_function(obj)+
* creating a function handle to a nested method is not supported
address@hidden
* +private_function+ could not be called from functions defined inside the
class file, only externally defined functions could access it (like
+method2_function+ or +static2_function+)
* an exception to the previous point is when the class is defined inside a
package, in which case even +method2_function+ and +static2_function+ cannot
call +private_function+
* inconsistency when taking function handle to a member method:
address@hidden sometimes works, but address@hidden never does
Some of these bugs have been reported before, e.g #41723, #45351.
I ran the tests in Octave 4.2.1, I appreciate if someone could try it in
dev...
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?45444>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
- [Octave-bug-tracker] [bug #45444] Private functions inside namespace and class directories, John W. Eaton, 2017/06/20
- [Octave-bug-tracker] [bug #45444] Private functions inside namespace and class directories,
Amro <=
- [Octave-bug-tracker] [bug #45444] Private functions inside namespace and class directories, Amro, 2017/06/24
- [Octave-bug-tracker] [bug #45444] Private functions inside namespace and class directories, Avinoam Kalma, 2017/06/28
- [Octave-bug-tracker] [bug #45444] Private functions inside namespace and class directories, Amro, 2017/06/28
- [Octave-bug-tracker] [bug #45444] Private functions inside namespace and class directories, Avinoam Kalma, 2017/06/30
- [Octave-bug-tracker] [bug #45444] Private functions inside namespace and class directories, Amro, 2017/06/30
- [Octave-bug-tracker] [bug #45444] Private functions inside namespace and class directories, Avinoam Kalma, 2017/06/30