octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #57403] pkg.m loads packages before their depe


From: Philip Nienhuis
Subject: [Octave-bug-tracker] [bug #57403] pkg.m loads packages before their dependencies
Date: Sat, 14 Dec 2019 08:17:24 -0500 (EST)
User-agent: Mozilla/5.0 (Windows NT 6.1; rv:52.0) Gecko/20100101 Firefox/52.0

Follow-up Comment #5, bug #57403 (project octave):

@Markus,
I also feel that you can look at it in several ways and that addpath()'s way
of adding directories to the path is probably what most users expect - if they
expect anything special at all. I really doubt if those users are fully aware
of the side effects as regards shadowing.
The order of adding directories to the path is usually irrelevant, in the
majority of cases one only wants Octave to find functions. Load order only
gets relevant when shadowing comes into play.
For the case at hand, shadowing other package functions hasn't been a
consideration until now JuanPi tripped over it; only shadowing of core
functions has been an issue.

IMO "the principle of least surprise" can be perceived in different ways as
well. To me addpath's behavior was a bit of a surprise once I realized that it
screws up pkg.m otherwise carefully assessed dependency ordering.
As you may infer from my posts in the maintainers ML thread, it took me a
while before I fully realized the implications, and -ref. your comment #2- the
same seems to apply for you.

__why should the order of precedence of the given paths be different dependent
on whether they are added to the front or the back of the load path?__

Simple: I guess no one has ever thought deeply about it, neither Octave nor
Matlab developers.
But I'll ask Matlab support, maybe they do have a reason.

I don't understand your last remark - you refer to the addpath() cset don't
you?
addpath()'s load order (right to left) is exactly the same regardless of the
'-begin' or '-end' flag, you can check yourself. So IMO my suggested sentence
is correct. But adding another sentence there may make it a bit more clear:
"The net effect is that the order of directories in the path equals the
user-specified order".
Or maybe change the whole thing:
"If multiple directories are specified they end up in the path in the same
order as specified.  Be aware that to get that together directories are added
one by one in reverse order, i.e., from right to left."


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?57403>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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