help-octave
[Top][All Lists]
Advanced

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

Global functions taking precedence over subfunctions


From: John W. Eaton
Subject: Global functions taking precedence over subfunctions
Date: Thu, 1 Sep 2005 21:53:30 -0400

On  1-Sep-2005, Rafael Laboissiere wrote:

| I do not know whether the following is a bug or a feature.  Consider the
| two following files:
| 
| %%%%%%%%%%%%%% f.m %%%%%%%%%%%%%%%%
| function f;
|   g;
|   function g
|     disp ("local g")
| %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|       
| %%%%%%%%%%%%%% g.m %%%%%%%%%%%%%%%%
| function g
|   disp("global g");
| %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|         
| Put only f.m in LOADPATH and you have:
| 
| > f
| local g
| 
| Put now g.m in LOADPATH, restart Octave, and you will have:
| 
| > f
| global g
| 
| The global definition is taking precedence over the local one.  Is it
| normal?

No, it's a bug.

Please try the following patch.  This diff is relative to the current
CVS.  The patch for 2.1.x is similar.

Thanks,

jwe



-------------------------------------------------------------
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
-------------------------------------------------------------



reply via email to

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