[Top][All Lists]

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

Re: Package precedence?

From: Mike Miller
Subject: Re: Package precedence?
Date: Mon, 12 Nov 2018 09:40:41 -0800
User-agent: Mutt/1.10.1 (2018-07-13)

On Mon, Nov 12, 2018 at 04:26:15 -0600, roland65 wrote:
> some of the functions implemented in different packages can have the same
> name. For example, nan and statistics packages have the same functions
> std(), median(), corrcoef(), etc.

These specific functions are actually part of Octave's core library, not
the Octave Forge statistics package. Are these the particular functions
you are asking about?

> In my .octaverc, I load these packages:
> load nan
> load statistics
> However, whatever the order of these lines, the functions selected by Octave
> are always those of the nan package (because of the alphabetical order?).

Yes, functions that are provided by a loadable package will override
functions that are in Octave's core library.

> Is there a way to tell Octave to get first the functions from the statistics
> package?

Packages that are loaded last will override earlier packages. If you
look at a function that is actually provided by the statistics package,
for example 'normpdf', you should see the results you wanted.

There is no simple way to load a package such that its functions do not
override Octave's core library functions. You can try manipulating the
load path directly, or consider not loading the nan package when you
don't want to use it.


Attachment: signature.asc
Description: PGP signature

reply via email to

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