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

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

[Octave-bug-tracker] [bug #63753] wrong function called after changing d


From: Rik
Subject: [Octave-bug-tracker] [bug #63753] wrong function called after changing directory
Date: Tue, 7 Feb 2023 12:04:38 -0500 (EST)

Update of bug #63753 (project octave):

             Open/Closed:                    Open => Closed                 

    _______________________________________________________

Follow-up Comment #3:

I still don't see a use case for this.  If the functions do different things
then why would they have the same name?  Generally directories are used to
organize related functions and then addpath() or rmpath() are used to add a
group of functions at a time.  In this case, if you want to access functions
in both directories 'a' and 'b' you would add both to your path with


addpath ('a:b')


BUT, you wouldn't want to have two functions with the same name because Octave
would run only one of them.  Because 'a' was listed first it would be
'a/myfcn.m' which would be run.

Imagine a use case where you want to have trig functions calculated for either
inputs in radians or inputs in degrees.  In this case, you could make a
directory 'trigradian' and a directory 'trigdegree' and have a file sin.m in
each of them.  But, you wouldn't add both of these to your path.  Instead, you
would choose which convention you were going to use and then use 'addpath' on
just one of the directories.

Incidentally, instead of "addpath ('.', 0)" it would be clearer to use
"rehash" for what you are trying to do in comment #2.

It seems you have found a solution for your needs so I will close this report.


    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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