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: Markus Mützel
Subject: [Octave-bug-tracker] [bug #57403] pkg.m loads packages before their dependencies
Date: Sat, 14 Dec 2019 11:52:51 -0500 (EST)
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:72.0) Gecko/20100101 Firefox/72.0

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

Thanks for the explanation. Now I get what you are trying to say.

If it is important that some of the paths are already in the load path when
another path is added, "pkg" should probably not rely on the implementation
details of "addpath". It would probably be better to add the paths separately
in that specific order.
Since loading the packages is probably not time critical, a "for" loop should
be good enough.
Maybe also add a comment explaining the reasoning so that no one reverts the
change in the future.
I am thinking about something like:

## Add the paths to the packages consecutively to the load path.
## Start from the back to have the correct dependency order.
for i_pkg = numel (dirs):-1:1
  addpath (dirs{i_pkg});
endfor


With respect to the documentation change for addpath, I believe the
misunderstanding is from the two possible meanings of "order" in that case. It
could refer to the order the paths appear in the load path (as in: which path
appears first in the final load path). But it could also refer to the
chronological sequence in which the paths are added (as in: which path is
added first while extending the search path).
What about the following wording:
"The newly added paths appear in the load path in the same order that they
appear in the arguments of addpath.  While extending the load path to the
front, the last path in the list of arguments is added first.  While extending
the load path to the end, the first path in the list of arguments is added
first."

This still sounds clumsy. Maybe someone with better English skills could
improve it.

    _______________________________________________________

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]