From bug-request at octave dot org Tue Apr 11 11:59:23 2006 Subject: Re: addpath, rmpath, savepath From: "Robert S. Weigel" To: "John W. Eaton" cc: octave bug mailing list Date: Tue, 11 Apr 2006 09:17:34 -0500 --Boundary_(ID_TAWBNUpvr6IPtN/UDTkz4A) Content-type: multipart/alternative; boundary="Boundary_(ID_XiYcroNcFthJYwVK+k+R6g)" Content-disposition: inline --Boundary_(ID_XiYcroNcFthJYwVK+k+R6g) Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7BIT John, > OK. Please submit a patch relative to the current CVS sources. Apology in advance for the lack of conciseness in what follows. Attached is a tarball with a file named path_demo.m that shows the difference between the existing addpath/rmpath functions and two new compatability xaddpath/xrmpath functions. xaddpath.m/xrmpath.m are major modifications and require the new functions cleanpath.m and checkpath.m. I was not able to make simple changes to the existing addpath/rmpath files because there were other major differences besides the ones I described in my first email. For example, * addpath('/tmp:/usr') will not add /tmp and /usr to LOADPATH whereas xaddpath will. * addpath('/tmp','-end','/usr','-begin') will add /tmp to the end and /usr to the beginning. xaddpath will try to put the directories /tmp, -end, and /usr to LOADPATH and warn that directory "-end" was not found. As you will see from the demo, the current addpath and rmpath do unexpected things besides allowing '.' to be removed or not be first. xaddpath and xrmpath allow strange things too (most are listed in the help). Note that xaddpath and xrmpath both generate a warning because they set DEFAULT_LOADPATH to ''. If you do want these functions (1) In what form (besides mods to the formatting)? (2) What about the DEFAULT_LOADPATH warning? There is an easy workaround but I left it out as I am certain that this is not the right way to deal with it. > Yes, Paul mentioned this, and I replied: > > This is not currently true, as warn_matlab_incompatible is applied > globally. I agree that it would be good for it to not apply to system > functions, but I'm not motivated enough to make the necessary changes > myself. Patches, anyone? Oops. I misparsed "system" as "operating system" and didn't realize you had answered my question. I'll consider adding a patch after I have a chance to study the how global variables are treated in the source code. Bob --Boundary_(ID_XiYcroNcFthJYwVK+k+R6g) Content-type: text/html; charset=us-ascii Content-transfer-encoding: 7BIT

John,

> OK. Please submit a patch relative to the current CVS sources.

Apology in advance for the lack of conciseness in what follows.

Attached is a tarball with a file named path_demo.m that shows the

difference between the existing addpath/rmpath functions and two new

compatability xaddpath/xrmpath functions. xaddpath.m/xrmpath.m are

major modifications and require the new functions cleanpath.m and

checkpath.m.

I was not able to make simple changes to the existing addpath/rmpath

files because there were other major differences besides the ones I

described in my first email. For example,

* addpath('/tmp:/usr') will not add /tmp and /usr to LOADPATH whereas

xaddpath will.

* addpath('/tmp','-end','/usr','-begin') will add /tmp to the end and

/usr to the beginning. xaddpath will try to put the directories /tmp,

-end, and /usr to LOADPATH and warn that directory "-end" was not found.

As you will see from the demo, the current addpath and rmpath do

unexpected things besides allowing '.' to be removed or not be first.

xaddpath and xrmpath allow strange things too (most are listed in the

help). Note that xaddpath and xrmpath both generate a warning because

they set DEFAULT_LOADPATH to ''.

If you do want these functions

(1) In what form (besides mods to the formatting)?

(2) What about the DEFAULT_LOADPATH warning? There is an easy workaround but

I left it out as I am certain that this is not the right way to deal with it.

> Yes, Paul mentioned this, and I replied:

>

> This is not currently true, as warn_matlab_incompatible is applied

> globally. I agree that it would be good for it to not apply to system

> functions, but I'm not motivated enough to make the necessary changes

> myself. Patches, anyone?

Oops. I misparsed "system" as "operating system" and didn't realize you had answered my question. I'll consider adding a patch after I have a chance to study the how global variables are treated in the source code.

Bob

--Boundary_(ID_XiYcroNcFthJYwVK+k+R6g)-- --Boundary_(ID_TAWBNUpvr6IPtN/UDTkz4A) Content-type: application/x-tgz; name=xpath.tgz Content-transfer-encoding: base64 Content-disposition: attachment; filename=xpath.tgz H4sIAH2sO0QCA+1ce3PbRpL3v8GnaNPlJbGBSYJ6+A6yHNGvRFd+lSRXKuVzuUBwKCIGASwAWuJq dZ/9unseAN+S13ZyOUzZIgj09PRremZ+M+Bl6hfjzp1vWrpYHu7t0af7cK/L393dXf5U5Y7b3XX3 H/b23f3ena7r7nZ7d2Dvznco07zwM4A7FyI8F9EmOpHld/5y5ZL9f+kPh3TRnnwr/+9Lf6/wv+ti cEj/73d39x/ifXd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tev5jiqtFloomN6UEleMzRGlV 4LQ2Jc8LXy03aY5DJ8BpwzcPeQc7GPvxucj17ve66RbZMEfDBL6caKGl4IL+JHzUQcpcmpBI83Ao 2LS05ZjDsYVfgywcyDMLk5nafRYTP4zQHi8qP4RiWX+HFVMfe/4HW+gBW4YeVrcFMThQDD+3zA8P UL02LLHVoz7OM+TUSr5OrxsyjWjjEACM9tXt0T2uQMvdiktl7QIX9UhEv5JBhNWflyGmjkVNO6sV oJt8UJ2DtPIDHPxWvnEoY9Lo4n7OR2C4WXoRwbzvQaHuzL35oUXkiJJROUysaSwuU2yDtlfH/Bsi 2n/8BgMFBM5eQIFsGltDj5EUAyFd2S7tTdx10DMHgrMp0DT7IkkIBuCD+tjHMejMURaL355Ac75O CnWkZSXfAYaeOY9eeXdCBamFrGa06bt8uJ2PslPPGOlfZbnwY/ZSXu5V55ZFyN2xSTXZBFraKtg7 TZeR5yyo09g/WYSG/Er0/iBRjl9qXgn6E9DeOP3EDvVvwHidwUWSffIz3mkYTAvsupEY8YkeYoZO PwZ/AoHICj9UscFrHgWwUGvyJNWFP5O76r7KgiFv7FtPkkF9BLEudalLXepSl7rUpS51qUtd6lKX utSlLnWpS13qUpe61KUudalLXepSl7rUpS51qUtd6vLvl/8FkUBmrwB4AAA= --Boundary_(ID_TAWBNUpvr6IPtN/UDTkz4A)-- ------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.octave.org How to fund new projects: http://www.octave.org/funding.html Subscription information: http://www.octave.org/archive.html -------------------------------------------------------------