help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Conflicting function names in separate toolboxes


From: Markus Mützel
Subject: Re: Conflicting function names in separate toolboxes
Date: Wed, 20 May 2020 13:38:30 +0200

Am 20. Mai 2020 um 13:22 Uhr schrieb "babelproofreader":
> I have recently downloaded a toolbox to try out but find when I try using it
> I get errors because the name(s) of some functions mirror those in a
> different toolbox and I presume they are in conflict with regard to
> inputs/outputs, e.g. the demo.m file calls a function called minFunc.m and
> then errors and when I call help minFunc the help text returned in terminal
> references a minFunc.m contained in a completely different toolbox.
>
> Is there some way of temporarily prioritising a toolbox such that the
> functions within it are called in preference to similarly named functions in
> different toolboxes?

Octave looks for matching function names in the search path from top to bottom.
The functions of toolboxes whose path appears earlier in the search path have 
priority over those of toolboxes whose path appears later.
Usually the paths are added to the top of the search path when loading a 
package. So package that are loaded later might shadow functions of previously 
loaded packages.
Long story short: You can "prioritize" toolboxes by changing their load order.

HTH,
Markus



reply via email to

[Prev in Thread] Current Thread [Next in Thread]