On Fri, Jan 18, 2019 at 15:21:59 -0500, Andrew Janke wrote:
I notice that when the PKG_ADD file is called, the architecture-specific
directory of the package has been added to the Octave path, but the main
package directory has not. So PKG_ADD can't call any non-octfile functions
in the package. Is this expected?
Have you tried adding a PKG_ADD file to the "inst" directory?
I agree it's not very clearly documented, but PKG_ADD can exist in any
directory that gets added to the load path.
It's more of an implementation detail of both the 'pkg load' command and
the addpath function that the arch-specific directory is added to the
path first, followed by the arch-independent directory.
The ordering comes from the way that load_packages_and_dependencies
passes package dirs into the addpath function.
The documentation for PKG_ADD doesn't specify what the package loading state
will be when PKG_ADD and PKG_DEL are called.
https://octave.org/doc/v4.4.1/Creating-Packages.html#Creating-Packages.
Could that be added?
We could document that the arch-specific directory is added to the load
path first, followed by the arch-indep directory, and turn that detail
into an explicit documented design decision.