GNU Octave  4.4.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
fcn-info.cc
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 1993-2018 John W. Eaton
4 Copyright (C) 2009 VZLU Prague, a.s.
5 
6 This file is part of Octave.
7 
8 Octave is free software: you can redistribute it and/or modify it
9 under the terms of the GNU General Public License as published by
10 the Free Software Foundation, either version 3 of the License, or
11 (at your option) any later version.
12 
13 Octave is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17 
18 You should have received a copy of the GNU General Public License
19 along with Octave; see the file COPYING. If not, see
20 <https://www.gnu.org/licenses/>.
21 
22 */
23 
24 #if defined (HAVE_CONFIG_H)
25 # include "config.h"
26 #endif
27 
28 #include "file-ops.h"
29 
30 #include "fcn-info.h"
31 #include "interpreter-private.h"
32 #include "interpreter.h"
33 #include "load-path.h"
34 #include "ov-fcn.h"
35 #include "ov-usr-fcn.h"
36 #include "parse.h"
37 #include "symrec.h"
38 #include "symscope.h"
39 #include "symtab.h"
40 
41 namespace octave
42 {
45  {
47 
48  load_path& lp
49  = __get_load_path__ ("fcn_info::fcn_info_rep::load_private_function");
50 
51  std::string file_name = lp.find_private_fcn (dir_name, name);
52 
53  if (file_name.empty ())
54  return retval;
55 
56  octave_value ov_fcn = load_fcn_from_file (file_name, dir_name);
57 
58  if (ov_fcn.is_undefined ())
59  return retval;
60 
61  octave_function *tmpfcn = ov_fcn.function_value ();
62 
63  if (! tmpfcn)
64  return retval;
65 
66  std::string class_name;
67 
68  size_t pos = dir_name.find_last_of (sys::file_ops::dir_sep_chars ());
69 
70  if (pos != std::string::npos)
71  {
72  std::string tmp = dir_name.substr (pos+1);
73 
74  if (tmp[0] == '@')
75  class_name = tmp.substr (1);
76  }
77 
78  tmpfcn->mark_as_private_function (class_name);
79 
80  private_functions[dir_name] = ov_fcn;
81 
82  return ov_fcn;
83  }
84 
87  {
89 
90  std::string dir_name;
91 
92  load_path& lp
93  = __get_load_path__ ("fcn_info::fcn_info_rep::load_class_constructor");
94 
95  std::string file_name = lp.find_method (name, name, dir_name, package_name);
96 
97  if (! file_name.empty ())
98  {
99  octave_value ov_fcn
100  = load_fcn_from_file (file_name, dir_name, name,
101  package_name);
102 
103  if (ov_fcn.is_defined ())
104  {
105  // Note: ov_fcn may be an octave_classdef_meta object instead
106  // of the actual constructor function.
107 
108  retval = ov_fcn;
109 
110  class_constructors[name] = retval;
111  class_methods[name] = retval;
112  }
113  }
114  else
115  {
116  // Classdef constructors can be defined anywhere in the path, not
117  // necessarily in @-folders. Look for a normal function and load it.
118  // If the loaded function is a classdef constructor, store it as such
119  // and restore function_on_path to its previous value.
120 
121  octave_value old_function_on_path = function_on_path;
122 
123  octave_value maybe_cdef_ctor = find_user_function ();
124 
125  if (maybe_cdef_ctor.is_defined ())
126  {
127  octave_function *fcn = maybe_cdef_ctor.function_value (true);
128 
129  if (fcn && fcn->is_classdef_constructor ())
130  {
131  retval = maybe_cdef_ctor;
132 
133  class_constructors[name] = retval;
134  class_methods[name] = retval;
135 
136  function_on_path = old_function_on_path;
137  }
138  }
139  }
140 
141  return retval;
142  }
143 
146  {
148 
149  if (full_name () == dispatch_type)
150  retval = load_class_constructor ();
151  else
152  {
153  cdef_manager& cdm
154  = __get_cdef_manager__ ("fcn_info::fcn_info_rep::load_class_method");
155 
156  octave_function *cm = cdm.find_method_symbol (name, dispatch_type);
157 
158  if (cm)
159  retval = octave_value (cm);
160 
161  if (! retval.is_defined ())
162  {
163  std::string dir_name;
164 
165  load_path& lp = __get_load_path__ ("fcn_info::fcn_info_rep::load_class_method");
166 
167  std::string file_name = lp.find_method (dispatch_type, name,
168  dir_name);
169 
170  if (! file_name.empty ())
171  {
172  octave_value ov_fcn
173  = load_fcn_from_file (file_name, dir_name,
174  dispatch_type);
175 
176  if (ov_fcn.is_defined ())
177  {
178  octave_function *tmpfcn = ov_fcn.function_value ();
179 
180  if (tmpfcn && tmpfcn->is_class_method (dispatch_type))
181  {
182  retval = ov_fcn;
183 
184  class_methods[dispatch_type] = retval;
185  }
186  }
187  }
188 
189  if (retval.is_undefined ())
190  {
191  // Search parent classes
192 
193  symbol_table& symtab
194  = __get_symbol_table__ ("fcn_info::fcn_info_rep::load_class_method");
195 
196  const std::list<std::string>& plist =
197  symtab.parent_classes (dispatch_type);
198 
199  std::list<std::string>::const_iterator it = plist.begin ();
200 
201  while (it != plist.end ())
202  {
203  retval = find_method (*it);
204 
205  if (retval.is_defined ())
206  {
207  class_methods[dispatch_type] = retval;
208  break;
209  }
210 
211  it++;
212  }
213  }
214 
215  if (retval.is_undefined ())
216  {
217  // Search for built-in functions that are declared to
218  // handle specific types.
219 
220  if (built_in_function.is_defined ())
221  {
222  octave_function *fcn = built_in_function.function_value ();
223 
224  if (fcn && fcn->handles_dispatch_class (dispatch_type))
225  {
226  retval = built_in_function;
227 
228  class_methods[dispatch_type] = retval;
229  }
230  }
231  }
232  }
233  }
234 
235  return retval;
236  }
237 
238  // :-) JWE, can you parse this? Returns a 2D array with second dimension equal
239  // to btyp_num_types (static constant). Only the leftmost dimension can be
240  // variable in C/C++. Typedefs are boring.
241 
243  {
244  static builtin_type_t sup_table[btyp_num_types][btyp_num_types];
245  for (int i = 0; i < btyp_num_types; i++)
246  for (int j = 0; j < btyp_num_types; j++)
247  {
248  builtin_type_t ityp = static_cast<builtin_type_t> (i);
249  builtin_type_t jtyp = static_cast<builtin_type_t> (j);
250  // FIXME: Is this really right?
251  bool use_j =
252  (jtyp == btyp_func_handle || ityp == btyp_bool
253  || (btyp_isarray (ityp)
254  && (! btyp_isarray (jtyp)
255  || (btyp_isinteger (jtyp) && ! btyp_isinteger (ityp))
256  || ((ityp == btyp_double || ityp == btyp_complex
257  || ityp == btyp_char)
258  && (jtyp == btyp_float
259  || jtyp == btyp_float_complex)))));
260 
261  sup_table[i][j] = (use_j ? jtyp : ityp);
262  }
263 
264  return sup_table;
265  }
266 
269  builtin_type_t& builtin_type)
270  {
271  static builtin_type_t (*sup_table)[btyp_num_types] = build_sup_table ();
272  std::string dispatch_type;
273 
274  int n = args.length ();
275 
276  if (n > 0)
277  {
278  int i = 0;
279  builtin_type = args(0).builtin_type ();
280  if (builtin_type != btyp_unknown)
281  {
282  for (i = 1; i < n; i++)
283  {
284  builtin_type_t bti = args(i).builtin_type ();
285  if (bti != btyp_unknown)
286  builtin_type = sup_table[builtin_type][bti];
287  else
288  {
289  builtin_type = btyp_unknown;
290  break;
291  }
292  }
293  }
294 
295  if (builtin_type == btyp_unknown)
296  {
297  // There's a non-builtin class in the argument list.
298  dispatch_type = args(i).class_name ();
299 
300  symbol_table& symtab = __get_symbol_table__ ("get_dispatch_type");
301 
302  for (int j = i+1; j < n; j++)
303  {
304  octave_value arg = args(j);
305 
306  if (arg.builtin_type () == btyp_unknown)
307  {
308  std::string cname = arg.class_name ();
309 
310  // Only switch to type of ARG if it is marked superior
311  // to the current DISPATCH_TYPE.
312  if (! symtab.is_superiorto (dispatch_type, cname)
313  && symtab.is_superiorto (cname, dispatch_type))
314  dispatch_type = cname;
315  }
316  }
317  }
318  else
319  dispatch_type = btyp_class_name[builtin_type];
320  }
321  else
322  builtin_type = btyp_unknown;
323 
324  return dispatch_type;
325  }
326 
329  {
330  builtin_type_t builtin_type;
331  return get_dispatch_type (args, builtin_type);
332  }
333 
334  // Find function definition according to the following precedence list:
335  //
336  // private function
337  // class method
338  // class constructor
339  // command-line function
340  // autoload function
341  // function on the path
342  // built-in function
343  //
344  // Matlab documentation states that constructors have higher precedence
345  // than methods, but that does not seem to be the case.
346 
348  fcn_info::fcn_info_rep::find (const octave_value_list& args, bool local_funcs)
349  {
350  octave_value retval = xfind (args, local_funcs);
351 
352  if (retval.is_undefined ())
353  {
354  // It is possible that the user created a file on the fly since
355  // the last prompt or chdir, so try updating the load path and
356  // searching again.
357 
358  load_path& lp = __get_load_path__ ("fcn_info::fcn_info_rep::find");
359 
360  lp.update ();
361 
362  retval = xfind (args, local_funcs);
363  }
364 
365  return retval;
366  }
367 
370  bool local_funcs)
371  {
372  if (local_funcs)
373  {
374  symbol_scope curr_scope
375  = __get_current_scope__ ("fcn_info::fcn_info_rep::xfind");
376 
377  octave_user_function *current_fcn
378  = curr_scope ? curr_scope.function () : nullptr;
379 
380  // Local function.
381 
382  if (current_fcn)
383  {
384  std::string fcn_file = current_fcn->fcn_file_name ();
385 
386  // For anonymous functions we look at the parent scope so that if
387  // they were defined within class methods and use local functions
388  // (helper functions) we can still use those anonymous functions
389 
390  if (current_fcn->is_anonymous_function ())
391  {
392  if (fcn_file.empty ()
393  && curr_scope.parent_scope ()
394  && curr_scope.parent_scope ()->function () != nullptr)
395  fcn_file
396  = curr_scope.parent_scope ()->function ()->fcn_file_name();
397  }
398 
399  if (! fcn_file.empty ())
400  {
401  str_val_iterator r = local_functions.find (fcn_file);
402 
403  if (r != local_functions.end ())
404  {
405  // We shouldn't need an out-of-date check here since
406  // local functions may ultimately be called only from
407  // a primary function or method defined in the same
408  // file.
409 
410  return r->second;
411  }
412  }
413  }
414 
415  // Private function.
416 
417  if (current_fcn)
418  {
419  std::string dir_name = current_fcn->dir_name ();
420 
421  if (! dir_name.empty ())
422  {
423  str_val_iterator q = private_functions.find (dir_name);
424 
425  if (q == private_functions.end ())
426  {
427  octave_value val = load_private_function (dir_name);
428 
429  if (val.is_defined ())
430  return val;
431  }
432  else
433  {
434  octave_value& fval = q->second;
435 
436  if (fval.is_defined ())
437  out_of_date_check (fval, "", false);
438 
439  if (fval.is_defined ())
440  return fval;
441  else
442  {
443  octave_value val = load_private_function (dir_name);
444 
445  if (val.is_defined ())
446  return val;
447  }
448  }
449  }
450  }
451  }
452 
453  // Class methods.
454 
455  if (! args.empty ())
456  {
457  std::string dispatch_type = get_dispatch_type (args);
458 
459  octave_value fcn = find_method (dispatch_type);
460 
461  if (fcn.is_defined ())
462  return fcn;
463  }
464 
465  // Class constructors. The class name and function name are the same.
466 
467  str_val_iterator q = class_constructors.find (name);
468 
469  if (q == class_constructors.end ())
470  {
471  octave_value val = load_class_constructor ();
472 
473  if (val.is_defined ())
474  return val;
475  }
476  else
477  {
478  octave_value& fval = q->second;
479 
480  if (fval.is_defined ())
481  out_of_date_check (fval, name);
482 
483  if (fval.is_defined ())
484  return fval;
485  else
486  {
487  octave_value val = load_class_constructor ();
488 
489  if (val.is_defined ())
490  return val;
491  }
492  }
493 
494  // Command-line function.
495 
496  if (cmdline_function.is_defined ())
497  return cmdline_function;
498 
499  // Autoload?
500 
502 
503  if (fcn.is_defined ())
504  return fcn;
505 
506  // Function on the path.
507 
508  fcn = find_user_function ();
509 
510  if (fcn.is_defined ())
511  return fcn;
512 
513  // Package
514 
515  fcn = find_package ();
516 
517  if (fcn.is_defined ())
518  return fcn;
519 
520  // Built-in function (might be undefined).
521 
522  return built_in_function;
523  }
524 
525  // Find the definition of NAME according to the following precedence
526  // list:
527  //
528  // built-in function
529  // function on the path
530  // autoload function
531  // command-line function
532  // private function
533  // subfunction
534 
535  // This function is used to implement the "builtin" function, which
536  // searches for "built-in" functions. In Matlab, "builtin" only
537  // returns functions that are actually built-in to the interpreter.
538  // But since the list of built-in functions is different in Octave and
539  // Matlab, we also search up the precedence list until we find
540  // something that matches. Note that we are only searching by name,
541  // so class methods and constructors are skipped.
542 
545  {
546  octave_value retval = x_builtin_find ();
547 
548  if (! retval.is_defined ())
549  {
550  // It is possible that the user created a file on the fly since
551  // the last prompt or chdir, so try updating the load path and
552  // searching again.
553 
554  load_path& lp = __get_load_path__ ("fcn_info::fcn_info_rep::builtin_find");
555 
556  lp.update ();
557 
558  retval = x_builtin_find ();
559  }
560 
561  return retval;
562  }
563 
566  {
567  // Built-in function.
568  if (built_in_function.is_defined ())
569  return built_in_function;
570 
571  // Function on the path.
572 
574 
575  if (fcn.is_defined ())
576  return fcn;
577 
578  // Autoload?
579 
580  fcn = find_autoload ();
581 
582  if (fcn.is_defined ())
583  return fcn;
584 
585  // Command-line function.
586 
587  if (cmdline_function.is_defined ())
588  return cmdline_function;
589 
590  // Private function.
591 
592  symbol_scope curr_scope
593  = __get_current_scope__ ("fcn_info::fcn_info_rep::x_builtin_find");
594 
595  octave_user_function *current_fcn = curr_scope ? curr_scope.function ()
596  : nullptr;
597 
598  if (current_fcn)
599  {
600  std::string dir_name = current_fcn->dir_name ();
601 
602  if (! dir_name.empty ())
603  {
604  str_val_iterator q = private_functions.find (dir_name);
605 
606  if (q == private_functions.end ())
607  {
608  octave_value val = load_private_function (dir_name);
609 
610  if (val.is_defined ())
611  return val;
612  }
613  else
614  {
615  octave_value& fval = q->second;
616 
617  if (fval.is_defined ())
618  out_of_date_check (fval);
619 
620  if (fval.is_defined ())
621  return fval;
622  else
623  {
624  octave_value val = load_private_function (dir_name);
625 
626  if (val.is_defined ())
627  return val;
628  }
629  }
630  }
631  }
632 
633  // Local function.
634 
635  if (current_fcn)
636  {
637  std::string fcn_file = current_fcn->fcn_file_name ();
638 
639  if (! fcn_file.empty ())
640  {
641  str_val_iterator r = local_functions.find (fcn_file);
642 
643  if (r != local_functions.end ())
644  {
645  // We shouldn't need an out-of-date check here since local
646  // functions may ultimately be called only from a primary
647  // function or method defined in the same file.
648 
649  return r->second;
650  }
651  }
652  }
653 
654  // Subfunction. I think it only makes sense to check for
655  // subfunctions if we are currently executing a function defined
656  // from a .m file.
657 
658  if (curr_scope)
659  {
660  octave_value val = curr_scope.find_subfunction (name);
661 
662  if (val.is_defined ())
663  return val;
664  }
665 
666  return octave_value ();
667  }
668 
671  {
673 
674  str_val_iterator q = class_methods.find (dispatch_type);
675 
676  if (q == class_methods.end ())
677  {
678  octave_value val = load_class_method (dispatch_type);
679 
680  if (val.is_defined ())
681  return val;
682  }
683  else
684  {
685  octave_value& fval = q->second;
686 
687  if (fval.is_defined ())
688  out_of_date_check (fval, dispatch_type);
689 
690  if (fval.is_defined ())
691  return fval;
692  else
693  {
694  octave_value val = load_class_method (dispatch_type);
695 
696  if (val.is_defined ())
697  return val;
698  }
699  }
700 
701  return retval;
702  }
703 
706  {
707  // Autoloaded function.
708 
709  if (autoload_function.is_defined ())
710  out_of_date_check (autoload_function);
711 
712  if (! autoload_function.is_defined ())
713  {
714  std::string file_name = lookup_autoload (name);
715 
716  if (! file_name.empty ())
717  {
718  size_t pos = file_name.find_last_of (sys::file_ops::dir_sep_chars ());
719 
720  std::string dir_name = file_name.substr (0, pos);
721 
722  octave_value ov_fcn
723  = load_fcn_from_file (file_name, dir_name, "", "", name, true);
724 
725  if (ov_fcn.is_defined ())
726  autoload_function = octave_value (ov_fcn);
727  }
728  }
729 
730  return autoload_function;
731  }
732 
735  {
736  // Function on the path.
737 
738  if (function_on_path.is_defined ())
739  out_of_date_check (function_on_path);
740 
741  if (function_on_path.is_undefined ())
742  {
743  std::string dir_name;
744 
745  load_path& lp =
746  __get_load_path__ ("fcn_info::fcn_info_rep::find_user_function");
747 
748 
749  std::string file_name = lp.find_fcn (name, dir_name, package_name);
750 
751  if (! file_name.empty ())
752  {
753  octave_value ov_fcn =
754  load_fcn_from_file (file_name, dir_name, "", package_name);
755 
756  if (ov_fcn.is_defined ())
757  function_on_path = ov_fcn;
758  }
759  }
760 
761  return function_on_path;
762  }
763 
766  {
767  // FIXME: implement correct way to check out of date package
768  //if (package.is_defined ())
769  // out_of_date_check (package);
770 
771  if (package.is_undefined ())
772  {
773  cdef_manager& cdm
774  = __get_cdef_manager__ ("fcn_info::fcn_info_rep::find_package");
775 
776  octave_function *fcn = cdm.find_package_symbol (full_name ());
777 
778  if (fcn)
779  package = octave_value (fcn);
780  }
781 
782  return package;
783  }
784 
785  void
787  {
788  if (built_in_function.is_defined ())
789  {
790  octave_function *fcn = built_in_function.function_value ();
791 
792  if (fcn)
793  {
794  if (fcn->handles_dispatch_class (klass))
795  warning ("install_built_in_dispatch: '%s' already defined for class '%s'",
796  name.c_str (), klass.c_str ());
797  else
798  fcn->push_dispatch_class (klass);
799  }
800  }
801  else
802  error ("install_built_in_dispatch: '%s' is not a built-in function",
803  name.c_str ());
804  }
805 
808  {
809  std::map<std::string, octave_value> m
810  = {{ "name", full_name () },
811  { "package", package.dump () },
812  { "local_functions", dump_function_map (local_functions) },
813  { "private_functions", dump_function_map (private_functions) },
814  { "class_methods", dump_function_map (class_methods) },
815  { "class_constructors", dump_function_map (class_constructors) },
816  { "cmdline_function", cmdline_function.dump () },
817  { "autoload_function", autoload_function.dump () },
818  { "function_on_path", function_on_path.dump () },
819  { "built_in_function", built_in_function.dump () }};
820 
821  return octave_value (m);
822  }
823 
825  dump_function_map (const std::map<std::string, octave_value>& fcn_map)
826  {
827  if (fcn_map.empty ())
828  return octave_value (Matrix ());
829 
830  std::map<std::string, octave_value> info_map;
831 
832  for (const auto& nm_fcn : fcn_map)
833  {
834  std::string nm = nm_fcn.first;
835  const octave_value& fcn = nm_fcn.second;
836  info_map[nm] = fcn.dump ();
837  }
838 
839  return octave_value (info_map);
840  }
841 }
octave_value find(const octave_value_list &args, bool local_funcs)
Definition: fcn-info.cc:348
octave_value builtin_find(void)
Definition: fcn-info.cc:544
octave_value x_builtin_find(void)
Definition: fcn-info.cc:565
octave_value dump_function_map(const std::map< std::string, octave_value > &fcn_map)
Definition: fcn-info.cc:825
octave_function * find_package_symbol(const std::string &pack_name)
octave_value load_class_constructor(void)
Definition: fcn-info.cc:86
octave_value load_class_method(const std::string &dispatch_type)
Definition: fcn-info.cc:145
octave_value dump(void) const
Definition: fcn-info.cc:807
std::string dir_sep_chars(void)
Definition: file-ops.cc:242
std::map< std::string, octave_value > private_functions
Definition: fcn-info.h:205
identity matrix If supplied two scalar respectively For allows like xample val
Definition: data.cc:4986
bool empty(void) const
Definition: ovl.h:98
octave_value find_method(const std::string &dispatch_type)
Definition: fcn-info.cc:670
OCTINTERP_API octave_value load_fcn_from_file(const std::string &file_name, const std::string &dir_name="", const std::string &dispatch_type="", const std::string &package_name="", const std::string &fcn_name="", bool autoload=false)
void error(const char *fmt,...)
Definition: error.cc:578
bool is_superiorto(const std::string &a, const std::string &b)
Definition: symtab.cc:345
octave_function * find_method_symbol(const std::string &method_name, const std::string &class_name)
bool btyp_isarray(builtin_type_t btyp)
Definition: ov-base.h:106
bool is_defined(void) const
Definition: ov.h:523
octave_value find_user_function(void)
Definition: fcn-info.cc:734
OCTINTERP_API std::string lookup_autoload(const std::string &nm)
symbol_scope __get_current_scope__(const std::string &who)
cdef_manager & __get_cdef_manager__(const std::string &who)
builtin_type_t
Definition: ov-base.h:71
virtual bool is_classdef_constructor(const std::string &="") const
Definition: ov-fcn.h:102
std::string find_method(const std::string &class_name, const std::string &meth, std::string &dir_name, const std::string &pack_name="")
Definition: load-path.h:77
octave_value arg
Definition: pr-output.cc:3244
octave_function * fcn
Definition: ov-class.cc:1754
static builtin_type_t(* build_sup_table(void))[btyp_num_types]
Definition: fcn-info.cc:242
std::list< std::string > parent_classes(const std::string &dispatch_type)
Definition: symtab.h:639
bool is_defined(void) const
Definition: ov-fcn.h:68
octave_value dump(void) const
Definition: ov.h:1399
symbol_table & __get_symbol_table__(const std::string &who)
nd deftypefn *std::string name
Definition: sysdep.cc:647
std::shared_ptr< symbol_scope_rep > parent_scope(void) const
Definition: symscope.h:653
OCTAVE_EXPORT octave_value_list isdir nd deftypefn *std::string nm
Definition: utils.cc:975
std::string find_private_fcn(const std::string &dir, const std::string &fcn, const std::string &pack_name="")
Definition: load-path.h:122
std::string find_fcn(const std::string &fcn, std::string &dir_name, const std::string &pack_name="")
Definition: load-path.h:109
std::string get_dispatch_type(const octave_value_list &args, builtin_type_t &builtin_type)
Definition: fcn-info.cc:268
std::string btyp_class_name[btyp_num_types]
Definition: ov-base.cc:87
std::map< std::string, octave_value >::iterator str_val_iterator
Definition: fcn-info.h:45
virtual bool handles_dispatch_class(const std::string &) const
Definition: ov-fcn.h:117
virtual bool is_class_method(const std::string &="") const
Definition: ov-fcn.h:105
octave_value find_subfunction(const std::string &name) const
Definition: symscope.h:862
double tmp
Definition: data.cc:6252
virtual void mark_as_private_function(const std::string &cname="")
Definition: ov-fcn.h:129
octave_value retval
Definition: data.cc:6246
octave_value xfind(const octave_value_list &args, bool local_funcs)
Definition: fcn-info.cc:369
octave_function * function_value(bool silent=false) const
virtual octave_value dump(void) const
Definition: ov-base.cc:1139
std::string class_name(void) const
Definition: ov.h:1291
Definition: dMatrix.h:36
octave_value find_method(const std::string &dispatch_type) const
Definition: fcn-info.h:252
std::string dir_name(void) const
Definition: ov-fcn.h:144
bool btyp_isinteger(builtin_type_t btyp)
Definition: ov-base.h:100
void update(void) const
Definition: load-path.cc:363
load_path & __get_load_path__(const std::string &who)
bool is_anonymous_function(void) const
Definition: ov-usr-fcn.h:332
void warning(const char *fmt,...)
Definition: error.cc:801
return octave_value(v1.char_array_value() . concat(v2.char_array_value(), ra_idx),((a1.is_sq_string()||a2.is_sq_string()) ? '\'' :'"'))
std::string fcn_file_name(void) const
Definition: ov-usr-fcn.h:277
builtin_type_t builtin_type(void) const
Definition: ov.h:643
void install_built_in_dispatch(const std::string &klass)
Definition: fcn-info.cc:786
bool is_undefined(void) const
Definition: ov.h:526
octave_value find_package(void)
Definition: fcn-info.cc:765
octave_value find_autoload(void)
Definition: fcn-info.cc:705
bool out_of_date_check(octave_value &function, const std::string &dispatch_type, bool check_relative)
Definition: symtab.cc:116
octave_idx_type length(void) const
Definition: ovl.h:96
for i
Definition: data.cc:5264
octave_value find_autoload(void)
Definition: fcn-info.h:267
virtual octave_function * function_value(bool silent=false)
Definition: ov-base.cc:871
octave_value load_private_function(const std::string &dir_name)
Definition: fcn-info.cc:44
If this string is the system will ring the terminal sometimes it is useful to be able to print the original representation of the string
Definition: utils.cc:888
virtual void push_dispatch_class(const std::string &)
Definition: ov-fcn.h:115
octave_user_function * function(void)
Definition: symscope.h:930
octave_value find_user_function(void)
Definition: fcn-info.h:272