W3cubDocs

/Octave

11.9.7 Function Precedence

Given the numerous different ways that Octave can define a function, it is possible and even likely that multiple versions of a function, might be defined within a particular scope. The precedence of which function will be used within a particular scope is given by

  1. Subfunction A subfunction with the required function name in the given scope.
  2. Private function A function defined within a private directory of the directory which contains the current function.
  3. Class constructor A function that constructs a user class as defined in chapter Object Oriented Programming.
  4. Class method An overloaded function of a class as in chapter Object Oriented Programming.
  5. Command-line Function A function that has been defined on the command-line.
  6. Autoload function A function that is marked as autoloaded with See autoload.
  7. A Function on the Path A function that can be found on the users load-path. There can also be Oct-file, mex-file or m-file versions of this function and the precedence between these versions are in that order.
  8. Built-in function A function that is a part of core Octave such as numel, size, etc.

© 1996–2018 John W. Eaton
Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies.
Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one.Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions.
https://octave.org/doc/interpreter/Function-Precedence.html