[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #54052] the global statement clears previously
From: |
John W. Eaton |
Subject: |
[Octave-bug-tracker] [bug #54052] the global statement clears previously assigned values |
Date: |
Sat, 16 Jun 2018 10:40:06 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0 |
Update of bug #54052 (project octave):
Status: Ready For Test => In Progress
_______________________________________________________
Follow-up Comment #14:
Yes, if there is no global value for x defined, then
x = 12
global x
will make x global and preserve the local value. But if there is already a
global x, then the same statements will make x global but not change the
global value to match the local value. I see now that I got the warning
message wrong. I think we can make this behavior somewhat clearer by issuing
two different warnings:
warning: global value of 'x' initialized to existing local value
for the first case, and
warning: local value of 'x' changed to match existing global value
for the second.
I believe this behavior is compatible with Matlab's current behavior, but it
only issues the one "local value may have changed" warning, which is kind of
weird since it should be possible to warn when that actually does occur
instead of just that it could.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?54052>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
- [Octave-bug-tracker] [bug #54052] the global statement clears previously assigned values, (continued)
- [Octave-bug-tracker] [bug #54052] the global statement clears previously assigned values, Rik, 2018/06/13
- [Octave-bug-tracker] [bug #54052] the global statement clears previously assigned values, Michael Godfrey, 2018/06/13
- [Octave-bug-tracker] [bug #54052] the global statement clears previously assigned values, Mike Miller, 2018/06/13
- [Octave-bug-tracker] [bug #54052] the global statement clears previously assigned values, Markus Mützel, 2018/06/14
- [Octave-bug-tracker] [bug #54052] the global statement clears previously assigned values, Mike Miller, 2018/06/14
- [Octave-bug-tracker] [bug #54052] the global statement clears previously assigned values, John W. Eaton, 2018/06/14
- [Octave-bug-tracker] [bug #54052] the global statement clears previously assigned values, Michael Godfrey, 2018/06/14
- [Octave-bug-tracker] [bug #54052] the global statement clears previously assigned values, John W. Eaton, 2018/06/15
- [Octave-bug-tracker] [bug #54052] the global statement clears previously assigned values, Lars Kindermann, 2018/06/15
- [Octave-bug-tracker] [bug #54052] the global statement clears previously assigned values, Lars Kindermann, 2018/06/15
- [Octave-bug-tracker] [bug #54052] the global statement clears previously assigned values,
John W. Eaton <=
- [Octave-bug-tracker] [bug #54052] the global statement clears previously assigned values, Rik, 2018/06/18
- [Octave-bug-tracker] [bug #54052] the global statement clears previously assigned values, John W. Eaton, 2018/06/19
- [Octave-bug-tracker] [bug #54052] the global statement clears previously assigned values, Rik, 2018/06/19