octave-maintainers
[Top][All Lists]
Advanced

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

Re: package autoload


From: LachlanA
Subject: Re: package autoload
Date: Fri, 15 Apr 2016 22:15:10 -0700 (PDT)

Oliver Heimlich wrote
> Removal of autoload will (hopefully) have one big advantage: That people 
> add “pkg load” commands at the beginning of their script files. This 
> will make the script files portable(*) and other users can easily tell 
> that they miss a particular package if the script stops right at the 
> start on their computer.
> 
> I find this particularly important in scientific publications when you 
> can easily tell from a script which packages the author has intended to 
> use. Compare this with other languages where you have 
> import-/use-statements for functions that your source code uses (and you 
> need in your namespace).
> 
> (*) although it might break compatibility with MATLAB, I don't know.
> 
> Oliver

Yes, it would break matlab compatibility -- unless included within "if
exists ("OCTAVE_VERSION)" or some such.  I believe the nearest Matlab
equivalent would be "import  packagename.*", though that may do something
different.  That command also allows a subset of the functions to be
imported, which is useful for avoiding the overloading of core function
names.

Including the pkg command within the script also breaks scripts any time
that the packages are renamed or functions are shuffled between them, though
that doesn't happen all that often.



--
View this message in context: 
http://octave.1599824.n4.nabble.com/package-autoload-tp4676287p4676322.html
Sent from the Octave - Maintainers mailing list archive at Nabble.com.



reply via email to

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