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

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

[Octave-bug-tracker] [bug #42620] exist() does not use "class" argument


From: Rik
Subject: [Octave-bug-tracker] [bug #42620] exist() does not use "class" argument
Date: Sat, 20 Nov 2021 13:41:04 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.69 Safari/537.36

Follow-up Comment #8, bug #42620 (project octave):

When a classdef m-file exists Matlab returns 2 (because it is an m-file)
unless the programmer specifically narrows the search to classdef files.


exist inputParser
ans = 2
exist ('inputParser', 'class')
ans = 8


I recreated this behavior in Octave for compatibility.

On the larger question of parsing of the file, this is a problem for Octave
but not for Matlab.  Matlab specifically says in the documentation that they
make no determination about the viability of the file.  Octave's exist
function works differently because it searches through the symbol table which
means functions have to have been parsed correctly.  There is already a
warning in the documentation for exist that bad .mex or .oct files can crash
Octave because exist() will try to query them.

Finally, "container.Map" is a problem for Octave because of the algorithm used
for exist which tries to strip off an extension on the name of a file.  This
works fine for things like "ls.m" or "function.mex".  In this case, however, I
believe Octave is stripping what it views as the extension "Map" and then
querying the symbol table for a function "container" which does not exist.

    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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