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

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

[Octave-bug-tracker] [bug #45410] in Octave +package directories must be


From: Amro
Subject: [Octave-bug-tracker] [bug #45410] in Octave +package directories must be on path, in ML they must not be added to path
Date: Fri, 26 Jun 2015 13:48:02 +0000
User-agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:40.0) Gecko/20100101 Firefox/40.0

Follow-up Comment #4, bug #45410 (project octave):

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
<http://www.mathworks.com/help/matlab/search-path.html>, packages
<http://www.mathworks.com/help/matlab/matlab_oop/scoping-classes-with-packages.html#brfynt_-3>
and classes
<http://www.mathworks.com/help/matlab/matlab_oop/organizing-classes-in-folders.html#br5wlnh>,
and private functions
<http://www.mathworks.com/help/matlab/matlab_prog/private-functions.html>:


./testdir/+foo/
./testdir/+foo/bar.m
./testdir/+foo/private/baz.m


where "bar.m" is a function that calls a private function "baz.m".


function x = bar()
    x = baz();
end


and


function x = baz()
    x = pi;
end


In Octave the following fails (while it works fine in MATLAB):


>> addpath('C:testdir')
>> foo.bar()
error: 'baz' undefined near line 2 column 9
error: called from
    bar at line 2 column 7


I had to explicitly add the private folder to the path for it to work:


>> addpath('C:testdir+fooprivate')
>> foo.bar
ans =  3.1416


----

Similarly, private functions inside @-class folders:


./testdir/@MyClass/
./testdir/@MyClass/MyClass.m
./testdir/@MyClass/private/myfunc.m


Trying to call "myfun.m" from class methods will generate a similar 'undefined
function' error...


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?45410>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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