From bug-octave-request at bevo dot che dot wisc dot edu Mon Oct 4 12:42:19 1999 Subject: Re: Unidentified subject! From: "John W. Eaton" To: bug-octave at bevo dot che dot wisc dot edu Cc: Victor Eijkhout , bug-octave@bevo.che.wisc.edu Date: Mon, 4 Oct 1999 12:42:19 -0500 (CDT) On 4-Oct-1999, Joao Cardoso wrote: | Victor Eijkhout wrote: | > | > To: bug-octave at bevo dot che dot wisc dot edu | > Subject: 'global' statement with initialisation does not work if multiple invocations | > | > Bug report for Octave 2.0.13 configured for i686-pc-linux-gnu | > | > Description: | > ----------- | > | > A statement 'global = ' does not behave as an assignment | > when issued repeatedly. | > | > Repeat-By: | > --------- | > | > global x = 3; | > x = 5; | > global x = | | | Global variables can be initialized only once, as src/ChangeLog says: | | Wed Nov 19 00:08:13 1997 John W. Eaton | | * pt-decl.cc (tree_global_command::do_init): Initialize global | values to `[]'. Only perform explicit initialization once. As I remember, the reason for this change was to make it possible to fake static variables using a global variable. function f () global some_var = 0; ... endfunction In 2.1.x, there is a static declaration, so maybe this change is not really right. I'm open to suggestions. jwe --------------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. To ensure that development continues, see www.che.wisc.edu/octave/giftform.html Instructions for unsubscribing: www.che.wisc.edu/octave/archive.html ---------------------------------------------------------------------