[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #63753] wrong function called after changing d
From: |
anonymous |
Subject: |
[Octave-bug-tracker] [bug #63753] wrong function called after changing directory |
Date: |
Fri, 3 Feb 2023 16:26:41 -0500 (EST) |
URL:
<https://savannah.gnu.org/bugs/?63753>
Summary: wrong function called after changing directory
Project: GNU Octave
Submitter: None
Submitted: Fri 03 Feb 2023 09:26:39 PM UTC
Category: Interpreter
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: Incorrect Result
Status: None
Assigned to: None
Originator Name: mark
Originator Email:
Open/Closed: Open
Release: 7.3.0
Discussion Lock: Any
Operating System: Microsoft Windows
Fixed Release: None
Planned Release: None
_______________________________________________________
Follow-up Comments:
-------------------------------------------------------
Date: Fri 03 Feb 2023 09:26:39 PM UTC By: Anonymous
If there are two functions with the same name in different directories,
changing the directory does not result in the correct function being called. A
simple example:
a/test.m:
function test()
printf('correct version\n');
end
b/test.m:
function test()
printf('incorrect version, changing directory\n');
cd('../a');
test();
cd('../b');
end
Starting in directory 'b' and running 'test()', the expected output (and
output in version 6.1) is:
>> test()
incorrect version, changing directory
correct version
The output in version 7.3 is:
>> test()
incorrect version, changing directory
incorrect version, changing directory
incorrect version, changing directory
...
incorrect version, changing directory
error: max_recursion_depth exceeded
error: called from
test
test at line 3 column 3
Adding 'keyboard' to debug the function prevents the error:
b/test.m:
function test()
printf('incorrect version, changing directory\n');
cd('../a');
keyboard;
test();
cd('../b');
end
>> test();
incorrect version, changing directory
stopped in test at line 4 [\b\test.m]
4: keyboard;
keyboard> return;
correct version
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?63753>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
- [Octave-bug-tracker] [bug #63753] wrong function called after changing directory,
anonymous <=