comparison libinterp/corefcn/symtab.h @ 32847:cb3163ba60c1 stable

be more explicit about creation of invalid vs anonymous symbol_scope objects In changeset ea3458c1d884, the meaning of symbol_scope() changed from creating a valid but anonymous (unnamed) scope to creating an invalid scope. Require the intent to be clear by deleting the default constructor so that one must pass either nullptr or a name and provide convenience functions to explicitly create invalid or anonymous scopes. * symscope.h (symbol_scope::invalid, symbol_scope::anonymous): New static functions. (symbol_scope (const std::shared_ptr<symbol_scope_rep>)): Eliminate default argument value. (symbol_scope::symbol_scope ()): Delete. Replace uses with symbol_scope::invalid or symbol_scope::anonymous as appropriate.
author John W. Eaton <jwe@octave.org>
date Thu, 25 Jan 2024 09:36:49 -0500
parents 2e484f9f1f18
children
comparison
equal deleted inserted replaced
32846:5f6d699e88db 32847:cb3163ba60c1
83 83
84 octave_value find_autoload (const std::string& name); 84 octave_value find_autoload (const std::string& name);
85 85
86 octave_value 86 octave_value
87 builtin_find (const std::string& name, 87 builtin_find (const std::string& name,
88 const symbol_scope& search_scope = symbol_scope ()); 88 const symbol_scope& search_scope = symbol_scope::invalid ());
89 89
90 octave_value 90 octave_value
91 fcn_table_find (const std::string& name, 91 fcn_table_find (const std::string& name,
92 const octave_value_list& args = ovl (), 92 const octave_value_list& args = ovl (),
93 const symbol_scope& search_scope = symbol_scope ()); 93 const symbol_scope& search_scope = symbol_scope::invalid ());
94 94
95 // If NAME is of the form @CLASS/FUNCTION, call 95 // If NAME is of the form @CLASS/FUNCTION, call
96 // 96 //
97 // find_method (FUNCTION, CLASS) 97 // find_method (FUNCTION, CLASS)
98 // 98 //
100 // 100 //
101 // find_function (NAME, ovl ()) 101 // find_function (NAME, ovl ())
102 102
103 octave_value 103 octave_value
104 find_function (const std::string& name, 104 find_function (const std::string& name,
105 const symbol_scope& search_scope = symbol_scope ()); 105 const symbol_scope& search_scope = symbol_scope::invalid ());
106 106
107 // NAME should just be function name; dispatch type determined 107 // NAME should just be function name; dispatch type determined
108 // from types of ARGS. 108 // from types of ARGS.
109 109
110 octave_value 110 octave_value
111 find_function (const std::string& name, 111 find_function (const std::string& name,
112 const octave_value_list& args, 112 const octave_value_list& args,
113 const symbol_scope& search_scope = symbol_scope ()); 113 const symbol_scope& search_scope = symbol_scope::invalid ());
114 114
115 octave_value find_user_function (const std::string& name); 115 octave_value find_user_function (const std::string& name);
116 116
117 octave_value find_cmdline_function (const std::string& name); 117 octave_value find_cmdline_function (const std::string& name);
118 118