Fri 01 Sep 2017 10:38:17 PM UTC, comment #11:
I added a warning to Octave when adding package directories to the path. See cset (http://hg.savannah.gnu.org/hgweb/octave/rev/8785b3717140). I created a new warning ID "Octave:addpath-pkg". If you want identical behavior to Matlab you can use
I didn't bother to set this option when Octave is invoked with --traditional, but someone could if they really feel bothered about it.
|
Tue 30 Jun 2015 05:52:22 PM UTC, comment #10:
Well, I guess TMW have decided that if they state that you should not add directories of a certain type to the path, they should prevent it from happening, and warn you that it's not been done.
It can be helpful when automatically adding a load of directories to a path (which is exactly what my initialisation script does, stripping version control directories).
|
Tue 30 Jun 2015 04:20:14 PM UTC, comment #9:
If the user explicitly adds a directory to the path, then we should add it to the path. Maybe we can also print a warning but why prevent it if that's what the user wants to do?
|
Tue 30 Jun 2015 02:15:28 PM UTC, comment #8:
I can confirm that adding a "+package" folder to the path issues a warning and does not add the folder as a result.
Perhaps they should have issued an error instead..
(Tested in latest R2015a)
|
Tue 30 Jun 2015 02:06:53 PM UTC, comment #7:
@mtmiller
Done, see bug #45444
Feel free to delete my previous comment in this thread.
|
Tue 30 Jun 2015 01:37:57 PM UTC, comment #6:
So the remaining bug here is that Matlab reports a warning if a +-directory is added to the path. Are you sure that the directory is not added to the path? To me a warning message means that something was done anyway.
|
Tue 30 Jun 2015 01:34:56 PM UTC, comment #5:
Amro, please report that as a separate bug for private functions inside namespace and class directories.
|
Fri 26 Jun 2015 01:48:02 PM UTC, comment #4:
I wasn't sure if I should create a new bug or just update the current one, but here is an actual issue related to path, packages and classes, and private functions:
where "bar.m" is a function that calls a private function "baz.m".
and
In Octave the following fails (while it works fine in MATLAB):
I had to explicitly add the private folder to the path for it to work:
Similarly, private functions inside @-class folders:
Trying to call "myfun.m" from class methods will generate a similar 'undefined function' error...
|
Fri 26 Jun 2015 01:44:50 PM UTC, comment #3:
I wasn't sure if I should create a new bug or just update the current one, but here is an actual issue related to path, packages/classes, and private functions:
|
Fri 26 Jun 2015 07:30:49 AM UTC, comment #2:
Actually you're right, sorry, I was seeing a bug in my own code. I should have investigated more carefully.
However, there is still a possible minor bug regarding matlab compatibility. In Matlab addpath prevents adding the +directory to the path, you get a warning and the path is not addded:
In octave nothing prevents you from adding it to the path. I've no idea if it's an issue.
|
Fri 26 Jun 2015 12:29:26 AM UTC, comment #1:
Thanks for your bug report. I'm not sure what you mean by this. The directory containing the +package directory does need to be added to the path, but not the +package directory itself.
Are you seeing something different? Are you expecting something different?
|
Thu 25 Jun 2015 09:19:04 PM UTC, original submission:
In Octave +package directories must be on the path.
However, in Matlab they must explicitly not be added to path, and addpath refuses to add them. They are more like private directories in this respect.
|