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

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

[Octave-bug-tracker] [bug #64705] VM machine executed script clear the c


From: anonymous
Subject: [Octave-bug-tracker] [bug #64705] VM machine executed script clear the content of a global pre-declared global variable
Date: Thu, 21 Sep 2023 09:18:26 -0400 (EDT)

URL:
  <https://savannah.gnu.org/bugs/?64705>

                 Summary: VM machine executed script clear the content of a
global pre-declared global variable 
                   Group: GNU Octave
               Submitter: None
               Submitted: Thu 21 Sep 2023 01:18:24 PM UTC
                Category: None
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: None
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
                 Release: dev
         Discussion Lock: Any
        Operating System: Solaris/SunOS
           Fixed Release: None
         Planned Release: None


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Thu 21 Sep 2023 01:18:24 PM UTC By: Anonymous
An VM machine executed script clears a pre-declared global variable when being
(re) declared as global within the executed script. 
 

file test4.m
----------------
global x;
----------------


1) manually executed commands to declare x as global and set a value:

__enable_vm_eval__ (0);
global x;
x = 1;
display(x); whos

--> 

x = 1
Variables visible from the current scope:

variables in scope: top scope

  Attr   Name        Size                     Bytes  Class
  ====   ====        ====                     =====  =====
     g   x           1x1                          8  double


2) executing the script
source test4.m
disp(x); whos

-->
1
Variables visible from the current scope:

variables in scope: top scope

  Attr   Name        Size                     Bytes  Class
  ====   ====        ====                     =====  =====
     g   x           1x1                          8  double

3) executing the script using the VM
__enable_vm_eval__ (1);
source test4.m
disp(x); whos

-->
[](0x0)
Variables visible from the current scope:

variables in scope: top scope

  Attr   Name        Size                     Bytes  Class
  ====   ====        ====                     =====  =====
     g   x           0x0                          0  double











    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?64705>

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




reply via email to

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