|
From: | Markus Mützel |
Subject: | [Octave-bug-tracker] [bug #46849] Shadowing warning on every command for function in +package directory |
Date: | Fri, 18 Dec 2020 11:32:54 -0500 (EST) |
User-agent: | Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36 Edg/87.0.664.60 |
Update of bug #46849 (project octave): Operating System: GNU/Linux => Any _______________________________________________________ Follow-up Comment #6: The change in comment #2 is probably not exactly what we want. We already have the built-in function "meta.class" (and other similar ones). A file in "+meta/class.m" would shadow that function. We'd probably need to extract the (nested) namespace from the path and check with the correctly namespaced function. I'm not sure how namespaced functions are handled in the maps in `load_path`. But we'd probably need to prepend the namespace to the function name before this line: https://hg.savannah.gnu.org/hgweb/octave/file/3332f1964e59/libinterp/corefcn/load-path.cc#l1881 Looking at the code path that leads to the warning being repeated on every input: Do we really need to update the load path after each and every command? https://hg.savannah.gnu.org/hgweb/octave/file/3332f1964e59/libinterp/corefcn/input.cc#l841 in octave::base_reader::octave_gets // There is no need to update the load_path cache if there is no // user input. if (retval != "\n" && retval.find_first_not_of (" \t\n\r") != std::string::npos) { load_path& lp = m_interpreter.get_load_path (); lp.update (); That looks like a lot of work and disc IO without any changes effectively most of the time... _______________________________________________________ Reply to this item at: <https://savannah.gnu.org/bugs/?46849> _______________________________________________ Message sent via Savannah https://savannah.gnu.org/
[Prev in Thread] | Current Thread | [Next in Thread] |