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

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

[Octave-bug-tracker] [bug #59304] exist() does not find a class inside @


From: John W. Eaton
Subject: [Octave-bug-tracker] [bug #59304] exist() does not find a class inside @class directory
Date: Thu, 29 Oct 2020 17:57:10 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0

Follow-up Comment #6, bug #59304 (project octave):

What I meant by that is the @ftp directory containing ftp.m is not included in
the list of directories in the path, but the one containing the @ftp directory
is.

In Octave, the ftp object is a legacy class thing, as I believe it originally
was in Matlab.  But has Matlab's ftp object been rewritten to use classdef? 
You could possibly tell by doing something like


obj = ftp ('ftp.gnu.org')
properties (obj)


as I don't think properties works for legacy classes?

Classdef classes can also be defined in @ directories.

https://www.mathworks.com/help/matlab/matlab_oop/organizing-classes-in-folders.html

Finding functions in package directories looks like another bug in the exist
function.  You should be able to check for  containers.Map with


exist ('containers.Map')


I'm also curious to know whether Matlab's exist function returns 2 or 8 for
classdef files defined in .m files.  If it returns 8 (indicating a class file)
then I don't see how it can do that without examining the contents of the file
(at least to see whether it begins with a classdef keyword, not necessarily
parsing the whole file).  But the Matlab docs claim that it doesn't look at
the contents of the file. 

    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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