[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #42620] exist() does not use "class" argument
From: |
John W. Eaton |
Subject: |
[Octave-bug-tracker] [bug #42620] exist() does not use "class" argument |
Date: |
Mon, 22 Nov 2021 14:05:42 -0500 (EST) |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0 |
Follow-up Comment #9, bug #42620 (project octave):
I'm confused as to how Matlab can know to return 8 for
exist ('inputParser', 'class')
without looking inside the inputParser.m file. Does it also return 8 for
exist ('not_a_classdef_function', 'class')
?
In earlier versions, we did ask the symbol table to find functions. But in
the current definition of symbol_exist in variables.cc, it seems that we are
only checking the symbol table for variables or command-line functions (which
have already been parsed successfully or they wouldn't exist in the function
table). In earlier versions, we did ask the symbol table to find functions.
Everything else appears to use the load path.
If not specifically looking for a file, it seems to me that
exist foopkg.m
could be either a function "m" in the package "foopkg" or the file "foopkg.m".
If both exist, I suppose we should be finding the package function first? So
yes, we probably need to update the rules for parsing these names. Are
similar changes needed for the which function? Maybe we can share some code
for these jobs.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?42620>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/