octave-maintainers
[Top][All Lists]
Advanced

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

Re: package manager patch + problem


From: Paul Kienzle
Subject: Re: package manager patch + problem
Date: Wed, 28 Feb 2007 19:43:07 -0500


On Feb 28, 2007, at 8:35 AM, David Bateman wrote:

Paul Kienzle wrote:

On Feb 28, 2007, at 5:40 AM, David Bateman wrote:

Michael Goffioul wrote:

Looking at autoload(), it doesn't seem to load the file.
I suspect the which() command does, but it is not
immediately clear from glancing at the code.  Maybe
we could use the following instead:

    autoload("glog",file_in_loadpath("gf.oct"))

Yes, I also think it's due to "which": if you "which myfun"
where myfun is an oct-file named myfun.oct, but you don't
have a corresponding "DEFUN_DLD (myfun, ...)" statement
in the code, then "which" fails: this means that somehow,
the oct-file must be loaded and the symbol is searched.

Michael.



Is it better to workaround this with the autoload
commans in the PKG_ADD files or try and figure out
why which is loading the DLD functions and try and
stop it doing it..

As it is currently defined, which() is operating on
symbol table items, so I don't think you are going
to avoid loading the symbol at the same time.

My concern with file_in_loadpath() is that it might
return relative rather than absolute file filenames
(I don't know) but other than that I think it makes
it more clear what the autoload is doing.

- Paul


What about the solution in octave itself that uses

autoload ("airy", fullfile (fileparts (mfilename ("fullpath")),
"besselj.oct"));

in the PKG_ADD file in the directory with besselj.oct.
mfilename is run on the PKG_ADD file itself and there
is no concern that the path is not absolute..

The disadvantage is that the PKG_ADD file must be in
the same directory as the file being autoloaded..

The other disadvantage is that it is ugly.

The documentation for file_in_loadpath says it
returns the absolute path, and testing on
octave 2.1.69 OS X supports this.

- Paul



reply via email to

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