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

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

[Octave-bug-tracker] [bug #54052] the global statement clears previously


From: Mike Miller
Subject: [Octave-bug-tracker] [bug #54052] the global statement clears previously assigned values
Date: Mon, 4 Jun 2018 13:02:38 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0

Update of bug #54052 (project octave):

                Severity:              3 - Normal => 2 - Minor              
                  Status:                    None => Need Info              

    _______________________________________________________

Follow-up Comment #1:

>From the Matlab documentation

> If a variable with the same name as the global variable already exists in
the current workspace, MATLAB issues a warning and changes the value of that
variable and its scope to match the global variable.

That does not explicitly describe what happens when the global variable is
being defined for the first time. It seems open to interpretation whether the
global variable gets the value of the existing variable, or whether the
variable should be changed to inherit the default value of the global, i.e.
[].

If this is actual intentional behavior in Matlab, it would be nice to find a
reference saying that this can be relied on. Otherwise it's best to avoid
writing code that does this.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?54052>

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




reply via email to

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