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

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

[Octave-bug-tracker] [bug #36658] acceptance of "global a = b"


From: Rik
Subject: [Octave-bug-tracker] [bug #36658] acceptance of "global a = b"
Date: Fri, 29 Jun 2012 19:26:10 +0000
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:13.0) Gecko/20100101 Firefox/13.0.1

Follow-up Comment #3, bug #36658 (project octave):

What behavior is desirable?  It seems slightly more logical to me that if the
variable is already global, then the scoping operator is ignored and the
assignment takes place.

Sample Code:


octave:1> b = 2;
octave:2> global a = b
octave:3> a
a =  2
octave:4> b++;
octave:5> global a = b
octave:6> a
a =  2


I would vote for having a = 3 on the last line.

A second question is why the global scoping operator suppresses normal output.
 Usually a line which isn't terminated with a semicolon echoes its output, but
that isn't the case for global.

More Sample Code:


octave:1> x = 1
x =  1
octave:2> global y = 2





    _______________________________________________________

Reply to this item at:

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

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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